ProcessInstances.GetInstanceTasksAsync
Description
The API gets tasks associated with process instance using the specified process instance ID inside the connected Control Room.
Signature [C#]
Task<List<CRTaskInfo>> GetInstanceTasksAsync(string instanceId);
Properties
Input
Property | Description |
---|---|
instanceId | 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 Control Room.
Example
C#
public void GetInstanceTasks()
{
IControlRoomContext context = LoginControlRoom();
string instanceId = "e42a93f5d53245d788909fd655b41cfe";
List<CRTaskInfo> tasks = Task.Run(() => context.ProcessInstances.GetInstanceTasksAsync(instanceId)).Result;
foreach (CRTaskInfo task in tasks)
System.Console.WriteLine($"Task Name : {task.Name} \n");
}
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;
}