Skip to main content

ProcessInstances.GetActivityInstancesAsync

Description

The API gets activity instances of specified process instance ID inside the connected Control Room.

Signature [C#]

Task<List<ActivityInstance>> GetActivityInstancesAsync(string processInstanceId);

Properties

Input

PropertyDescription
processInstanceIdThe process instance id for which the activity instances must be retrieved.

Output

PropertyDescription
Task<List<ActivityInstance>>Returns list of activity instance.

Remarks

Use GetActivityInstancesAsync API to get activity instances of a process instance inside the connected Control Room.

Example

C#
public void GetActivityInstances()
{
IControlRoomContext context = LoginControlRoom();

string processInstanceId = "e42a93f5d53245d788909fd655b41cfe";

List<ActivityInstance> activityInstances = Task.Run(() => context.ProcessInstances.GetActivityInstancesAsync(processInstanceId)).Result;
foreach (ActivityInstance activityInstance in activityInstances)
System.Console.WriteLine("Activity Name: " + activityInstance.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;
}