Modify Process Instance Execution State Async

Submits a list of modification instructions to change a process instance's execution state async. A modification instruction is one of the following:

  • Starting execution before an activity
  • Starting execution after an activity on its single outgoing sequence flow
  • Starting execution on a specific sequence flow
  • Cancelling an activity instance, transition instance, or all instances (activity or transition) for an activity

Instructions are executed asynchronous and in the order they are provided in this request's body. Variables can be provided with every starting instruction.

The exact semantics of modification can be read about in the user guide.

Method

POST /process-instance/{id}/modification-async

Parameters

Path Parameters

Name Description
id The id of the process instance to modify.

Request Body

A JSON object with the following properties:

Name Description
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.
instructions A JSON array of modification instructions. The instructions are executed in the order they are in. An instruction may have the following properties:
Name Description
type Mandatory. One of the following values: cancel, startBeforeActivity, startAfterActivity, startTransition. A cancel instruction requests cancellation of a single activity instance or all instances of one activity. A startBeforeActivity instruction requests 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 types startTransition. Specifies the sequence flow to start.
activityInstanceId Can be used with instructions of type cancel. Specifies the activity instance to cancel. Valid values are the activity instance IDs supplied by the Get Activity Instance request.
transitionInstanceId Can be used with instructions of type cancel. Specifies the transition instance to cancel. Valid values are the transition instance IDs supplied by the Get Activity Instance request.
ancestorActivityInstanceId

Can be used with instructions of type startBeforeActivity, startAfterActivity, and startTransition. Valid values are the activity instance IDs supplied by the Get Activity Instance request.

If there are multiple parent activity instances of the targeted activity, this specifies the ancestor scope in which hierarchy the activity/transition is to be instantiated.

Example: When there are two instances of a subprocess and an activity contained in the subprocess is to be started, this parameter allows to specify under which subprocess instance the activity should be started.

annotation An arbitrary text annotation set by a user for auditing reasons.

Result

A JSON object corresponding to the Batch interface in the engine. Its properties are as follows:

Name Type Description
id String The id of the batch.
type String The type of the batch. See the User Guide for more information about batch types.
totalJobs Number The total jobs of a batch is the number of batch execution jobs required to complete the batch.
jobsCreated Number The number of batch execution jobs already created by the seed job.
batchJobsPerSeed Number The number of batch execution jobs created per seed job invocation. The batch seed job is invoked until it has created all batch execution jobs required by the batch (see totalJobs property).
invocationsPerBatchJob Number Every batch execution job invokes the command executed by the batch invocationsPerBatchJob times. E.g., for a process instance migration batch this specifies the number of process instances which are migrated per batch execution job.
seedJobDefinitionId String The job definition id for the seed jobs of this batch.
monitorJobDefinitionId String The job definition id for the monitor jobs of this batch.
batchJobDefinitionId String The job definition id for the batch execution jobs of this batch.
suspended Boolean Indicates whether this batch is suspended or not.
tenantId String The tenant id of the batch.
createUserId String The id of the user that created the batch.
startTime String The time the batch was started. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ.
executionStartTime String The time the batch execution was started, i.e., at least one batch job has been executed. Default format* yyyy-MM-dd'T'HH:mm:ss.SSSZ.
* For further information, please see the documentation.

Response Codes

Code Media type Description
200 application/json Request successful.
400 application/json At least one modification instruction misses required parameters.
403 application/json If the user is not allowed to execute batches. See the Introduction for the error response format.
500 application/json The modification cannot be performed, for example because it starts a failing activity.

Example

Request

POST /process-instance/aProcessInstanceId/modification-async

Request Body:

{
"skipCustomListeners": true,
"skipIoMappings": true,
"instructions": [
    {
      "type": "startBeforeActivity",
      "activityId": "activityId"
    },
    {
      "type": "cancel",
      "activityInstanceId": "anActivityInstanceId",
    }
  ],
"annotation": "Modified to resolve an error."
}

Response

Status 200.

{
  "id": "aBatchId",
  "type": "instance-modification",
  "totalJobs": 10,
  "batchJobsPerSeed": 100,
  "invocationsPerBatchJob": 1,
  "seedJobDefinitionId": "aSeedJobDefinitionId",
  "monitorJobDefinitionId": "aMonitorJobDefinitionId",
  "batchJobDefinitionId": "aBatchJobDefinitionId",
  "tenantId": "aTenantId"
}

On this Page: