This operation starts a process by sending a BPMN message using administrative access. Use it when an administrative script needs to start a process through a message start event.
The base request is:
start(startMessagePayload)
Use StartMessagePayload to specify the message that starts the process and, optionally, provide a business key and process variables. The message name must match a message start event configured in the process model.
The following example defines a start message with a business key and process variables:
const startMessagePayload = {
name: 'startOrderProcess',
businessKey: variables.businessKey,
variables: {
priority: 'HIGH',
orderId: variables.orderId
}
};
variables.process =
new RuntimeProcessInstanceAdminService()
.start(startMessagePayload);
In this example:
- name: 'startOrderProcess' specifies the BPMN message. The name must match a message start event configured in the process model.
- businessKey: variables.businessKey associates the new process instance with the specified business identifier.
- variables provides variables to the new process instance. priority is set to HIGH, and orderId receives the value of variables.orderId.
- start(startMessagePayload) sends the message and starts the process.