How to check if process instance was terminated or cancelled?

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.

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

1 Like

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