Job.ExecuteJobV2Async
Description
The Smart Buddy executes an existing job with job details provided by the connected Control Room.
Signature [C#]
Task<JobInfo> ExecuteJobV2Async(Dictionary<string, object> inputArgs, int processId, int? botId = null, string logLevel = "Information")
Properties
Input
Property | Description |
---|---|
inputArgs | Specify the job input arguments. |
processId | Specify the ProcessId to execute the job. |
botId | Specify the SmartBuddy Id to execute the job. |
logLevel | Specify the job log level. |
Output
Property | Description |
---|---|
Task<JobInfo> | Returns the job information of a current job. |
Remarks
Use ExecuteJobV2Async 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";
Dictionary<string, object> inputArgs = new Dictionary<string, object>();
inputArgs.Add(" ", "{ }");
JobInfo jobInfo = Task.Run(() => context.Jobs.ExecuteJobV2Async(inputArgs, processId, botId, logLevel)).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;
}