Job.SubmitJobV2Async
Description
This API submits the job for execution in the Control Room and returns Task<JobInfo>
Signature [C#]
Task<JobInfo> SubmitJobV2Async(Dictionary<string, object> inputArgs, int processId, string logLevel = "Information", int? botId = null, bool isAssistanBuddyJob = false, string initiatorName ="", int? initiatorType = null)
Properties
Input
| Property | Description | | :--- | :--- | | inputArgs | Specify the job input arguments. | | processId | Specify the ProcessId to execute the job. | | botId | Specify the bot Id to execute the job. | | logLevel | Specify the job log level. | | isAssistantBuddyJob | Specify the value that indicates whether the AssistantBuddy job is submitted. | | initiatorName | Specify the job's initiator name. | | initiatorType | Specify the initiator type of the job. |
Output
| Property | Description | | :--- | :--- | | Task<JobInfo> | Returns the information of a current job. |
Remarks
Use SubmitJobV2Async 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
public void SubmitJob()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");
int processId = 1;
int botId = 1;
string logLevel = "Information";
bool isAssistantBuddyJob = false;
string username = "tester";
Dictionary<string, object> inputArgs = new Dictionary<string, object>();
inputArgs.Add(" ", "{ }");
JobInfo jobInfo = Task.Run(() => context.Jobs.SubmitJobV2Async(inputArgs, processId, logLevel, botId, isAssistantBuddyJob, username).Result;
Console.WriteLine("JobId: " + jobInfo.JobId + ", Output: " + jobInfo.Output));
}
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;
}