Execute Modification

Executes a modification synchronously for multiple process instances. To modify a single process instance, use the Modify Process Instance Execution State method. To execute a modification asynchronously, use the Execute Modification Async (Batch) method.

For more information about the difference between synchronous and asynchronous execution of a modification, please refer to the related section of the user guide.

Method

POST /modification/execute`

Parameters

Request Body

A JSON object with the following properties:

Name Description
processDefinitionId The id of the process definition for the modification
skipCustomListeners Skip execution listener invocation for activities that are started or ended as part of this request.
skipIoMappings Skip execution of input/output variable mappings for activities that are started or ended as part of this request.
processInstanceIds A list of process instance ids to modify.
processInstanceQuery A process instance query like the request body described by POST /process-instance .
instructions A JSON array of modification instructions. The instructions are executed in the order they are in. An instruction may have the following properties:
type Mandatory. One of the following values: cancel, startBeforeActivity, startAfterActivity, startTransition. A startBeforeActivity and cancel instructions request to enter a given activity. A startAfterActivity instruction requests to execute the single outgoing sequence flow of a given activity. A startTransition instruction requests to execute a specific sequence flow.
activityId Can be used with instructions of types startBeforeActivity, startAfterActivity, and cancel. Specifies the activity the instruction targets.
transitionId Can be used with instructions of type startTransition. Specifies the sequence flow to start.
cancelCurrentActiveActivityInstances Can be used with instructions of type cancel. Prevents the deletion of new created activity instances.

Result

This method returns no content.

Response codes

Code Media type Description
204 Request successful.
400 application/json In case following parameters are missing: instructions, processDefinitionId, activityId or transitionId, processInstanceIds or processInstanceQuery, an exception of type InvalidRequestException is returned. See the Introduction for the error response format.

Example

Request

POST /modification/execute

Request Body:

{
  "processDefinitionId" : "aProcessDefinitionId",
  "instructions": [
    {
      "type": "startAfterActivity",
      "activityId": "aUserTask"
    },
    {
      "type": "cancel",
      "activityId": "anotherTask",
      "cancelCurrentActiveActivityInstances" : true
    }
  ],
  "processInstanceIds": [
    "aProcessInstance",
    "anotherProcessInstance"
  ],
  "processInstanceQuery": {
    "processDefinitionId": "aProcessDefinitionId"
  },
  "skipCustomListeners": true
}

Response

Status 204. No content.

On this Page: