Skip to main content

ProcessInstances.GetInstanceByIdAsync

Description

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

Signature [C#]

Task<ProcessInstance> GetInstanceByIdAsync(string instanceId);

Properties

Input

PropertyDescription
instanceIdThe process instance ID for which the process instance has to be retrieved.

Output

PropertyDescription
Task<ProcessInstance>Returns process instance.

Remarks

Use GetInstanceByIdAsync API to get process instance using process instance id inside the connected Control Room.

Example

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

string instanceId = "e42a93f5d53245d788909fd655b41cfe";

ProcessInstance processInstance = Task.Run(() => context.ProcessInstances.GetInstanceByIdAsync(instanceId)).Result;
System.Console.WriteLine("Instance Name: " + processInstance.InstanceName + "\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;
}