Skip to main content

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

PropertyDescription
inputArgsSpecify the Input arguments of the job.
processIdSpecify the ProcessId to execute the job.
botIdSpecify the bot Id to execute the job.
logLevelSpecify the log level of the job.
isAssistanBuddyJobSpecify the value that indicates whether the AssistantBuddy job is submitted.
waitForCompletionSpecify the value that indicates whether to wait for the job completion.
initiatorNameSpecify the initiator name of the job.
initiatorTypeSpecify 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;
}