I faced a strange problem: when I try to delete a process, listeners attached to a current task of this process are called. Why is it done this way? Is there a way to not to call listeners when process is deleted?
Maybe your Listeners listen to TASK DELETE Event which is thrown when TASK is deleted (not completed) and this happens if process is deleted.
I don’t know of such an event (TASK DELETE) at all. We have execution listeners that are bound to end event type.
Ah ok i am not 100% sure but i think end event of execution is thrown when process is deleted because it ends.
You could use Tasklistener instead and listen to complete event. This event is noch thrown if process instance is deleted.
This is correct.
Which API/interface do you use for deletion?
seems like it could work, though i’ll have to modify all listeners to implement TaskListener instead of JavaDelegate.
either cockpit or rest
In newer versions, you have the option to skip listener execution on deletion, see the query parameters documented here: https://docs.camunda.org/manual/7.8/reference/rest/process-instance/delete/