createProcessInstance($startEvent, $instanceName)
Creates and initializes a new process instance based on a StartEvent. The process instance will be initialized with either the provided name or a default name.
| Process name | Type | Type Description | Mandatory | Default |
|---|---|---|---|---|
| startEvent | StartEvent | Start event that defines the process to instantiate | Yes | - |
| name | Character string | Name for the new process instance | no | "newProcessInstance" |
Type: ProcessExecution
Returns the created and initialized process instance. If the startEvent parameter is null, returns null.
// Create a process instance with default name
createProcessInstance(startEvent)
// Create a process instance with specific name
createProcessInstance(startEvent, "Process-001")
Output: The newly created process instance.