How to check if process instance was terminated or cancelled?


#1

Is there any way to check in Flowable if process instance was terminated, or cancelled or just completed? Only checking if process has ended is not much, I want to distinguish terminate, cancel and complete actions.


#2

Hi,

The deleteProcessInstance method on RuntimeService allows you to define a deleteReason that you could use. How would you terminate a process instance and how would you cancel a process instance? If you use the terminate end event then you can check the last activity id for the process instance in the HistoricActivityInstance. As an alternative you could set a process variable as part of a script task or execution listener according to the path that was taken in the process instance.

Best regards,

Tijs


#3

Hi @tijs,

When I press the ‘Terminate Process Instance’ button in the admin tool, the popup goes away but the process has not been terminated. Also, in the popup box, there is not a delete reason question and input icon anymore. Why is this?

Thank you,
Nathan