This operation a process instance. Use it when a script needs to start another process and immediately receive the created process instance.
The base request is:
startProcess()
The following example starts a process using a process definition key and business key stored in process variables:
variables.process =
new RuntimeProcessInstanceService()
.startProcess({
payloadType: 'StartProcessPayload',
processDefinitionKey: variables.processKey,
businessKey: variables.businessKey
});
Use StartProcessPayload when a script starts a process immediately or starts a process instance that was created earlier.
The following example defines a payload that includes process metadata and variables:
const startProcessPayload = {
processDefinitionKey: 'orderProcess',
name: 'Order Review',
businessKey: variables.businessKey,
variables: {
orderId: variables.orderId,
priority: 'HIGH'
}
};