Skip to main content

ProcessInstances.GetActivityInstanceByInstIdAsync

Description

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

Signature [C#]

Task<ActivityInstance> GetActivityInstanceByInstIdAsync(string processInstanceId, string activityInstanceId);

Properties

Input

PropertyDescription
processInstanceIdThe process instance id in which the activity instance is located.
activityInstanceIdThe activity instance id for which the activity instance has to be retrieved.

Output

PropertyDescription
Task<ActivityInstance>Returns activity instance.

Remarks

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

Example

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

string processInstanceId = "e42a93f5d53245d788909fd655b41cfe";
string activityInstanceId = "58bfe04d347540188dfdb55f2e16f5ec";

ActivityInstance activityInstance = Task.Run(() => context.ProcessInstances.GetActivityInstanceByInstIdAsync(processInstanceId, activityInstanceId)).Result;
System.Console.WriteLine("Activity Name: " + activityInstance.Name);
}
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;
}