Skip to main content
Version: Current

Job.ExecuteJobAsync

Description​

The Smart Buddy executes an existing Job with provided job details from the connected AI Command Center and waits for the job to complete its execution.

warning

This API is deprecated. Use ExecuteJobV2Async instead.

Signature [C#]​

Task<JobInfo> ExecuteJobAsync(Dictionary<string, object> inputArgs, int processId, int? botId = null, string logLevel = "Information", TimeSpan? timeOut = null)

Properties​

Input​

PropertyDescription
inputArgsSpecify the Input arguments of the job.
processIdSpecify the ProcessId to execute the job.
botIdSpecify the SmartBuddy Id to execute the job.
logLevelSpecify the log level of the job.
timeOutThe timeout information of a job.

Output​

PropertyDescription
Task<JobInfo>Returns the job information of a current job.

Remarks​

Use ExecuteJobAsync API to execute the job from the connected AI Command Center.

Example​

C#
public void ExecuteJob()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");

int processId = 1;
int botId = 1;
string logLevel = "Information";
TimeSpan? timeOut = null
Dictionary&lt;string, object&gt; inputArgs = new Dictionary&lt;string, object&gt;();
inputArgs.Add(" ", "{ }");

JobInfo jobInfo = Task.Run(() => context.Jobs.ExecuteJobAsync(inputArgs, processId, botId, logLevel, timeOut)).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;
}