The following operations can be executed asynchronously

Asynchronous operations can be performed based on a list of specific instances as well as on the result of a query providing aresulting list of instances. If both a list of instances and a query are provided, the resulting set of affected instanceswill consist of the union of those two subsets.

Cancellation Of Running Process Instances

Cancellation of running process instances can be performed asynchronously using the following Java API method invocation:

  1. List<String> processInstanceIds = ...;
  2. runtimeService.deleteProcessInstancesAsync(
  3. processInstanceIds, null, REASON);

Deletion Of Historic Process Instances

Deletion of historic process instances can be performed asynchronously using the following Java API method invocation:

  1. List<String> historicProcessInstanceIds = ...;
  2. historyService.deleteHistoricProcessInstancesAsync(
  3. historicProcessInstanceIds, TEST_REASON);

Update Suspend State Of Process Instances

Update the suspension state of multiple process instances asynchronously using the following Java API method invocation:

  1. List<String> processInstanceIds = ...;
  2. runtimeService.updateProcessInstanceSuspensionState().byProcessInstanceIds(
  3. processInstanceIds).suspendAsync();

Setting Retries Of Jobs Associated With Process Instances

Setting retries of jobs associated with process instances can be performed asynchronously using the following Java API method invocation:

  1. List<String> processInstanceIds = ...;
  2. int retries = ...;
  3. managementService.setJobRetriesAsync(
  4. processInstanceIds, null, retries);

Setting Retries Of External Tasks

Setting retries of external tasks can be performed asynchronously using the following Java API method invocation:

  1. List<String> externalTaskIds = ...;
  2. externalTaskService.setRetriesAsync(
  3. externalTaskIds, TEST_REASON);

原文: https://docs.camunda.org/manual/7.9/user-guide/process-engine/batch-operations/