Deleting process instances asynchronously using processinstancequery


#1

I was using camunda rest api 7.9.0 distribution.

Actually i want to delete process instance based on tenantid and businesskey.

process-instance/post-delete/ in this api mentioned using processinstance query we can delete the process instance.

A JSON object with the following properties:

processInstanceIds : A list process instance ids to delete.
processInstanceQuery : A process instance query like the request body described by POST /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.

But there’s no examples with processinstance query request.

Can anyone provide the json request body for deleting process instances asynchronously using process instance query?

{
“deleteReason” : “aReason”,
“processInstanceIds”: [“aProcess”,“secondProcess”],
“skipCustomListeners” : true,
“skipSubprocesses” : true
}

Instead of processInstanceIds how to pass processinstancequery ?


#2

Here is an example:

POST /process-instance/delete
{
  "processInstanceQuery": {
    "processDefinitionId": "aProcessDefinitionId1"
  }
}

#3

Thanks.

Is it possible to start a multiple process instances as a batch with different business Keys?

I was using camunda rest api 7.9.0, i found batch process applicable for Activate/suspend process instances only. Is thare possibility to start a process instance as a batch? if yes, please share some references.


#4

Hi,

Currently such option doesn’t exist. You need to implement something by your own.

Best regards,
Yana


#5

@thorben, @Yana, @StephenOTT

Do we have any backlog for starting process instances as batch process?


#6

@aravindhrs how about you just create another process which does the batching for you. Create a definition with a startevent->callActivity->endEvent. Then make thya call activity multi-instance. Set the inputs for the call activity as expressions/variables. Then you can start the definition with a process variable which is a Array, where each item in the array is a object of variables to inject into the multiInstance.

So you don’t need a API to create a batch of processes. Just execute a single process definition which executes many instances each with their own business keys. You could also use a message event instead of a call activity. Which would make it very async.