Job.SubmitJobAsync
Description
This API submits the job for execution in the Control Room and waits for the job to complete its execution.
warning
This API is deprecated. Use Job.SubmitJobV2Aync instead.
Signature [C#]
Task<JobInfo> SubmitJobAsync(Dictionary<string, object> inputArgs, int processId, string logLevel = "Information", int? botId = null, bool isAssistanBuddyJob = false, bool waitForCompletion = false, string initiatorName ="", int? initiatorType = null)
Properties
Input
Property | Description |
---|---|
inputArgs | Specify the Input arguments of the job. |
processId | Specify the ProcessId to execute the job. |
botId | Specify the bot Id to execute the job. |
logLevel | Specify the log level of the job. |
isAssistantBuddyJob | Specify the value that indicates whether the AssistantBuddy job is submitted. |
waitForCompletion | Specify the value that indicates whether to wait for the job completion. |
initiatorName | Specify the initiator name of the job. |
initiatorType | Specify the initiator type of the job. |
Output
Property | Description |
---|---|
Task<JobInfo> | Returns the job information of a current job. |
Remarks
Use SubmitJobAsync API to submit a job for execution based on specified Assistant or Smart Buddy Id and other job details from the connected Control Room.
Example
C#
public void SubmitJob()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");
int processId = 1;
int botId = 1;
string logLevel = "Information";
TimeSpan? timeOut = null;
bool isAssistantBuddyJob = false;
string username = "tester";
Dictionary<string, object> inputArgs = new Dictionary<string, object>();
inputArgs.Add(" ", "{ }");
JobInfo jobInfo = Task.Run(() => context.Jobs.SubmitJobAsync(inputArgs, processId, logLevel, botId, isAssistantBuddyJob, false, username).Result;
Console.WriteLine("JobId: " + jobInfo.JobId + ", Output: " + jobInfo.Output));
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;
connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);
context.Open();
return context;
}