Cancel process instance in a batch
Prerequisites
- Run the Zeebe broker with endpoint
localhost:26500
(default). - Run the deploy a process example.
- Run the create a process instance example multiple times.
CancelProcessInstanceBatchCreator.java
This example demonstrates how to cancel multiple process instances using a batch operation in Zeebe. The batch operation is applied to all active root process instances matching the given filter object:
final CreateBatchOperationResponse result =
camundaClient
.newCreateBatchOperationCommand()
.processInstanceCancel()
.filter(b -> b.processDefinitionId(bpmnProcessId))
.send()
.join();