cancel
Showing results for 
Search instead for 
Did you mean: 

BpmnParseListener delete process

mitziuro
Champ in-the-making
Champ in-the-making
I delete a process instance with runtimeService.deleteProcessInstance.

Which method from BpmnParseListener it's useful for adding a listener relate with this event?

Can I add a listener for deleted tasks(process instance removal).
Or I'll have to do my own query to discover which tasks were deleted?
4 REPLIES 4

trademak
Star Contributor
Star Contributor
Hi,

There's no listener for process deletion. So yes you should write your own polling/query mechanism for this.

Best regards,

trademak
Star Contributor
Star Contributor
Please disregard my previous message. You can add an ExecutionListener on the process level with a event type "end".
This ExecutionListener is executed when the deleteProcessInstance is invoked.

Best regards,

ryanberg1
Champ in-the-making
Champ in-the-making
Hi Tijs,

Could you please confirm that an execution listener registered with the end event of a process will be executed when deleteProcessInstance is invoked?  I followed the path of execution through the source code, and I can't find where this would be occurring.

Thank you very much!
-Ryan

frederikherema1
Star Contributor
Star Contributor
Yes, an execution-listener which is defined on the process-definition (not on the end-event) will be called when the process is completed normally OR when it's deleted before completion. The delete-reason is also available at this time. If you have a listener defined on the end-event, it will only be called when the process actually reaches the end.