Restart Process Instance

Restarts process instances that were canceled or terminated synchronously. To execute the restart asynchronously, use the Restart Process Instance Async method.

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

Method

POST /process-definition/{id}/restart

Parameters

Path Parameters

Name Description
id The id of the process definition of the process instances to restart.

Request Body

A JSON object with the following properties:

Name Description
processInstanceIds A list of process instance ids to restart.
historicProcessInstanceQuery A historic process instance query like the request body described by POST /history/process-instance .
skipCustomListeners Skip execution listener invocation for activities that are started as part of this request.
skipIoMappings Skip execution of input/output variable mappings for activities that are started as part of this request.
initialVariables Set the initial set of variables during restart. By default, the last set of variables is used.
withoutBusinessKey Do not take over the business key of the historic process instance.
instructions A JSON array of 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: startBeforeActivity, startAfterActivity, startTransition. 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 and startAfterActivity. Specifies the activity the instruction targets.
transitionId Can be used with instructions of types startTransition. Specifies the sequence flow to start.

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, activityId or transitionId, processInstanceIds or historicProcessInstanceQuery, an exception of type InvalidRequestException is returned. See the Introduction for the error response format.

Example

Restarting one or more Process Instances with known processInstanceIds:

Request

POST /process-definition/aProcessDefinitionId/restart

Request Body:

{
  "instructions": [
    {
      "type": "startAfterActivity",
      "activityId": "aUserTask"
    }
  ],
  "processInstanceIds": [
    "aProcessInstance",
    "anotherProcessInstance"
  ],
  "initialVariables" : true,
  "skipCustomListeners" : true,
  "withoutBusinessKey" : true
}

Response

Status 204. No content.

Restarting one or more Process Instances using a historicProcessInstanceQuery:

Request

POST /process-definition/aProcessDefinitionId/restart

Request Body:

{
  "instructions": [
    {
      "type": "startAfterActivity",
      "activityId": "aUserTask"
    }
  ],
  "initialVariables" : true,
  "skipCustomListeners" : true,
  "withoutBusinessKey" : true,
  "historicProcessInstanceQuery": {
    "processDefinitionId": "aProcessDefinitionId",
    "processInstanceBusinessKey" : "businessKey"
  }
}

Response

Status 204. No content.

On this Page: