The following API functions are available:
Function |
Description |
GetBots |
Retrieves the list of bots in FoxHub. |
GetJobStatus |
Retrieves the status of a job in the queue. |
Init |
Initializes communication with FoxHub. |
Login |
Instructs FoxHub to log in using the specified credentials. |
QueueDataJob |
Adds a Data job to the queue. |
QueueSoloJob |
Adds a Solo job to the queue. |
RunJob |
Starts a job in the queue. |
StopJob |
Stops a job in the queue. |
GetBots
The GetBots function retrieves a dictionary of bots that have been added into FoxHub. Each dictionary entry includes the bot's ID and computer name.
Syntax:
C#
public Dictionary<int, string> GetBots(); |
VB.Net
Public GetBots() As Dictionary(Of Integer, String) |
Parameters:
- None
Return Value:
- Returns a dictionary of bots that have been added into FoxHub. Each dictionary entry includes the bot's ID and computer name.
Remarks:
- Before a bot can be retrieved, it must first be manually added into FoxHub.
Examples:
C#
//Create a Dictionary object to hold the list of bots: Dictionary<int, string> objBotDict;
//Get the list of bots: objBotDict = objFoxHub.GetBots(); |
VB.Net
'Create a Dictionary object to hold the list of bots: Dim objBotDict As New Dictionary(Of Integer, String)
'Get the list of bots: objBotDict = objFoxHub.GetBots() |
GetJobStatus
The GetJobStatus function retrieves the status of a Job in the FoxHub queue.
Syntax:
C#
public int GetJobStatus( int intQueueItemID); |
VB.Net
Public GetJobStatus( _ ByVal intQueueItemID As Integer) As Integer |
Parameters:
- intQueueItemID: [in] The ID of the desired queue item. This is the ID returned when calling QueueJob.
Return Value:
|
Remarks:
- None.
Examples:
C#
int intStatus; //Retrieve the job's status: intStatus = objFoxHub.GetJobStatus(intQueueItemID); |
VB.Net
Dim intStatus As Integer //Retrieve the job's status: intStatus = objFoxHub.GetJobStatus(intQueueItemID) |
Init
The Init function initializes communication with FoxHub. This function should be called before attempting other function calls.
Syntax:
C#
public bool Init(); |
VB.Net
Public Init() As Boolean |
Parameters:
- None.
Return Value:
- The function returns True if communication with FoxHub was successfully established and FoxHub is ready to receive commands. Otherwise, returns False.
Remarks:
This function may fail for the following reasons
- The FoxHub computer is turned off
- The FoxHub computer is unreachable due to network or firewall settings
- The FoxHub application is not running on the FoxHub computer
- The version of FoxHub is older than the version of the FoxHubAPI.dll being used
- An unexpected error occurred
Examples:
C#
//Initialize communication with FoxHub: if (objFoxHub.Init() == false) { //Communication with FoxHub failed! return; //Abort and do nothing. } |
VB.Net
'Initialize communication with FoxHub: If (objFoxHub.Init() = False) Then 'Communication with FoxHub failed! Return 'Abort and do nothing. End If |
Login
The Login function instructs FoxHub to log in using the specified credentials.
Syntax:
C#
public bool Login( string strDomain, string strUsername, string strPassword); |
VB.Net
Public Login( _ Optional ByVal strUsername As String = "", _ Optional ByVal strPassword As String = "", _ Optional ByVal strDomain As String = "") As Boolean |
Parameters:
- strUsername: [in, optional] The username to use for authentication. This parameter is required if Logins are turned on.
- strPassword: [in, optional] The password to use for authentication. This parameter is required if Logins are turned on.
- strDomain: [in, optional] The domain name to use for authentication. This parameter is required if Logins are turned on.
Return Value:
- The function returns True if the login was successful. Otherwise, returns False.
Remarks:
- If FoxHub is already logged in, this function will return True and will not switch to the specified user. If this function fails, try logging into FoxHub manually using the same credentials.
Examples:
C#
//Log into FoxHub using simply authentication: objFoxHub.LogIn("jdoe", "mypassword", "");
//Log into FoxHub using Active Directory (LDAP) authentication: objFoxHub.LogIn("jdoe", "mypassword", "mydomain"); |
VB.Net
'Log into FoxHub using Simply authentication: objFoxHub.LogIn("jdoe", "mypassword", "")
'Log into FoxHub using Active Directory (LDAP) authentication: objFoxHub.LogIn("jdoe", "mypassword", "mydomain") |
QueueDataJob
The QueueDataJob function adds a Data job to the queue in FoxHub.
Syntax:
C#
public int QueueDataJob( string strName, string strProjectPath, List<int> lstBotIDs, string strDataPath, string strImportTemplatePath, bool blnUnmarkRecs); |
VB.Net
Public QueueDataJob( ByVal strName As String, ByVal strProjectPath As String, ByVal lstBotIDs As List(Of Integer), ByVal strDataPath As String, ByVal strImportTemplatePath As String, ByVal blnUnmarkRecords As Boolean) As Integer |
Parameters:
- strName: [in] The name to assign to the job being added to the queue.
- strProjectPath: [in] The full project file path for the job.
- lstBotIDs: [in] The list of Bot IDs to assign to the job.
- strDataPath: [in] The full data file path for the job.
- strImportTemplatePath: [in] The full data import template file path for the job.
- blnUnmarkRecords: [in, optional] Indicates if the records should be unmarked when the job is run.
Return Value:
- Returns a unique integer ID assigned to the new Queue Item. Returns 0 if the Queue Item could not be created.
Remarks:
- The job will be added to the queue in a stopped state. Once the job has been added to the queue, you must call RunJob to run the job.
- This function will fail if either the specified project file path or data file path is invalid.
Examples:
C#
int intQueueItemID;
//Add a job to the queue. Assign all bots to the job: intQueueItemID = objFoxHub.QueueDataJob("New Job", "C:\MyProject.fox", objBotDict.Keys.ToList(), "C:\MyData.accdb", "", true); |
VB.Net
Dim intQueueItemID As Integer
'Add a job to the queue. Assign all bots to the job: intQueueItemID = objFoxHub.QueueDataJob("New Job", "C:\MyProject.fox", objBotDict.Keys.ToList(), "C:\MyData.accdb", "", True) |
QueueSoloJob
The QueueSoloJob function adds a Solo job to the queue in FoxHub.
C#
public int QueueSoloJob( string strName, string strProjectPath, List<int> lstBotIDs); |
VB.Net
Public QueueSoloJob( ByVal strName As String, ByVal strProjectPath As String, ByVal lstBotIDs As List(Of Integer)) As Integer |
Parameters
- strName: [in] The name to assign to the job being added to the queue.
- strProjectPath: [in] The full project file path for the job.
- lstBotIDs: [in] The list of Bot IDs to assign to the job.
- Note: Only the first available bot will pick up the Solo job.
Return Value:
- Returns a unique integer ID assigned to the new Queue Item. Returns 0 if the Queue Item could not be created.
Remarks:
- The job will be added to the queue in a stopped state. Once the job has been added to the queue, you must call RunJob to run the job.
- This function will fail if the specified project file path is invalid.
Examples:
C#
int intQueueItemID;
//Add a job to the queue. Assign all bots to the job: intQueueItemID = objFoxHub.QueueSoloJob("New Job", "C:\MyProject.fox", objBotDict.Keys.ToList()); |
VB.Net
Dim intQueueItemID As Integer
'Add a job to the queue. Assign all bots to the job: intQueueItemID = objFoxHub.QueueSoloJob("New Job", "C:\MyProject.fox", objBotDict.Keys.ToList()) |
RunJob
The RunJob function runs the specified job in the FoxHub queue.
Syntax:
C#
public bool RunJob( int intQueueItemID); |
VB.Net
Public RunJob( ByVal intQueueItemID As Integer) As Boolean |
Parameters:
- intQueueItemID: [in] The queue item ID of the job in the queue to run.
Return Value:
- Returns True if the job was started successfully. Otherwise, returns False.
Remarks:
- None.
Examples:
C#
//Run the job: objFoxHub.RunJob(intQueueItemID); |
VB.Net
'Run the job: objFoxHub.RunJob(intQueueItemID) |
StopJob
The StopJob function stops the specified job in the FoxHub queue.
Syntax:
C#
public bool StopJob( int intQueueItemID); |
VB.Net
Public StopJob( ByVal intQueueItemID As Integer) As Boolean |
Parameters:
- None.
Return Value:
- Returns True if the job was successfully stopped. Otherwise, returns False.
Remarks:
- None.
Examples:
C#
//Stop the job: objFoxHub.StopJob(intQueueItemID); |
VB.Net
'Stop the job: objFoxHub.StopJob(intQueueItemID) |
Comments
0 comments
Please sign in to leave a comment.