Deletes a set of process instances asynchronously (batch) based on a historic process instance query.

Method

POST /process-instance/delete-historic-query-based

Parameters

Request Body

A JSON object with the following properties:

Name Description
processInstanceIds A list of process instance ids to delete.
historicProcessInstanceQuery A historic process instance query like the request body described by POST /history/process-instance .
deleteReason A string with delete reason.
skipCustomListeners Skip execution listener invocation for activities that are started or ended as part of this request.
skipSubprocesses Skip deletion of the subprocesses related to deleted processes as part of this request.

Response Body

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

Name Value 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 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.
batchJobDefinitionId String The job definition id for the batch execution jobs of this batch.
suspended Boolean Indicates wheter this batch is suspened or not.
tenantId String The tenant id of the batch.

Response Codes

Code Media type Description
200 application/json Request successful.
400 application/json Returned if some of the query parameters are invalid, e. g. neither processInstanceIds, nor historicProcessInstanceQuery is present. See the Introduction for the error response format.

Example

Request

POST /process-instance/delete-historic-query-based

Request Body:

  1. {
  2. "historicProcessInstanceQuery": {
  3. "startedBefore": "2017-04-28T11:24:37.765+0200"
  4. },
  5. "deleteReason" : "aReason",
  6. "skipCustomListeners" : true,
  7. "skipSubprocesses" : true
  8. }

Response

Status 200 OK

  1. {
  2. "id": "aBatchId",
  3. "type": "aBatchType",
  4. "totalJobs": 10,
  5. "batchJobsPerSeed": 100,
  6. "jobsCreated": 10,
  7. "invocationsPerBatchJob": 1,
  8. "seedJobDefinitionId": "aSeedJobDefinitionId",
  9. "monitorJobDefinitionId": "aMonitorJobDefinitionId",
  10. "batchJobDefinitionId": "aBatchJobDefinitionId",
  11. "suspened": false,
  12. "tenantId": "aTenantId"
  13. }

原文: https://docs.camunda.org/manual/7.9/reference/rest/process-instance/post-delete-historic-query-based/