Job.ExecuteJobAsync
Description
The Smart Buddy executes an existing Job with provided job details from the connected Control Room 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
Property | Description |
---|---|
inputArgs | Specify the Input arguments of the job. |
processId | Specify the ProcessId to execute the job. |
botId | Specify the SmartBuddy Id to execute the job. |
logLevel | Specify the log level of the job. |
timeOut | The timeout information of a job. |
Output
Property | Description |
---|---|
Task<JobInfo> | Returns the job information of a current job. |
Remarks
Use ExecuteJobAsync API to execute the job from the connected Control Room.
Example
C#
public void ExecuteJob()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");
int processId = 1;
int botId = 1;
string logLevel = "Information";
TimeSpan? timeOut = null
Dictionary<string, object> inputArgs = new Dictionary<string, object>();
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;
}