Delete case instance using java api

Hi :slight_smile:

Help needed. I have an case instance id. How can I delete a case instance programmatically using java api.

Thanks.

Hi Tatiana,
These two examples might be what you’re looking for:

execution.getProcessEngineServices().getCaseService().completeCaseExecution(caseExecutionId);

execution.getProcessEngineServices().getCaseService().terminateCaseExecution(caseExecutionId);

Joe

Thank you, but that’s not what I need.
I found how to delete through the сommandContext.

@Tatiana This is something that we need to do as well. Can you share how you removed a case instance?