ProcessInstances.GetInstanceTasksAsync
Description
The API gets tasks associated with process instance using the specified process instance ID inside the connected AI Command Center.
Signature [C#]
Task<List<CRTaskInfo>> GetInstanceTasksAsync(string instanceId);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
instanceId | string | Required | The process instance ID of which the tasks must be retrieved. |
Output
| Property | Description |
|---|---|
| Task<List<CRTaskInfo>> | Returns the tasks associated with specified process instance id. |
Remarks
Use GetInstanceTasksAsync API to get the tasks associated with process instance using process instance id inside the connected AI Command Center.
Example
C#
public async Task GetInstanceTasks()
{
IControlRoomContext context = LoginControlRoom();
try
{
string instanceId = "e42a93f5d53245d788909fd655b41cfe";
List<CRTaskInfo> tasks = await context.ProcessInstances.GetInstanceTasksAsync(instanceId);
foreach (CRTaskInfo task in tasks)
System.Console.WriteLine($"Task Name : {task.Name} \n");
}
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.