Job.SubmitJobAsync
Description
The API submits the job for execution with specified Smart or Assistant Buddy Id and other job details from the connected Control Room.
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. |
isAssistanBuddyJob | 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
| Task<JobInfo> | Returns the 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 isAssistanBuddyJob = 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, isAssistanBuddyJob, 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;
}