Job.SubmitJobAsync
Description
This API submits the job for execution in the AI Command Center and waits for the job to complete its execution.
warning
This API is deprecated. Use Job.SubmitJobV2Async instead.
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
| Parameter | Type | Required / default | Description |
|---|---|---|---|
inputArgs | Dictionary<string, object> | Required | Specify the Input arguments of the job. |
processId | int | Required | Specify the ProcessId to execute the job. |
botId | int? | Optional; null | Specify the bot Id to execute the job. |
logLevel | string | Optional; "Information" | Specify the log level of the job. |
isAssistanBuddyJob | bool | Optional; false | Specify the value that indicates whether the AssistantBuddy job is submitted. |
waitForCompletion | bool | Optional; false | Specify the value that indicates whether to wait for the job completion. |
initiatorName | string | Optional; "" | Specify the initiator name of the job. |
initiatorType | int? | Optional; null | Specify the initiator type of the job. |
Output
| Property | Description |
|---|---|
| Task<JobInfo> | Returns the job 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 AI Command Center.
Example
C#
public async Task SubmitJob()
{
IControlRoomContext context = LoginControlRoom();
try
{
int processId = 1;
int botId = 1;
string logLevel = "Information";
TimeSpan? timeOut = null;
bool isAssistantBuddyJob = false;
string username = "tester";
Dictionary<string, object> inputArgs = new Dictionary<string, object>();
// Add entries whose names and types match the process input arguments.
JobInfo jobInfo = await context.Jobs.SubmitJobAsync(inputArgs, processId, logLevel, botId, isAssistantBuddyJob, false, username);
Console.WriteLine("JobId: " + jobInfo.JobId + ", Output: " + jobInfo.Output);
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}
See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.