ProcessInstances.CreateAsync
Description
The API creates a process instance with the specified details inside the connected Control Room.
Signature [C#]
Task<string> CreateAsync(ProcessCreationParameters parameters);
Properties
Input
Property | Description |
---|---|
parameters | The process instance details to be created. |
Output
Property | Description |
---|---|
string | Returns newly created process instance id. |
Remarks
Use CreateAsync API to create a new process instance inside the connected Control Room.
Example
C#
public void CreateProcessInstance()
{
IControlRoomContext context = LoginControlRoom();
ProcessCreationParameters parameters = new ProcessCreationParameters()
{
ProcessId = 9,
ProcessInstanceName = "DemoProcessInstance"
};
string instanceId = Task.Run(() => context.ProcessInstances.CreateAsync(parameters)).Result;
System.Console.WriteLine("Process Instance Id: " + instanceId);
}
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;
}