How to excute execution or task listener if a process is canceled manually

Hi guys,

I have got a question regarding executing some java logic, if you cancel the process manually via task app.

For this reason lets have a look at the sample process. Every user task got task execution listeners at the create event, there will be a rest request for adding a notification to an external service. At the end event this notification will be disabled, also via rest request.

sample_process

Now the problem appears, if you are going to manually end the process for example via task app. If the user task A is currently not completed, the listener to disable the notification, won’t be executed so the notification remains active in the external service.

task_app-cancel_process_manually

Do someone of you maybe know how to handle this? So if I end the process manually, I have to execute at least some logic to call the external service and disable the notification.

Greetings,
Thomas

Hi Thomas,

Exactly as you wrote. The question is from where this logic could be executed.There are several possibilities so just 2 of them:

  1. add the logic to the rest endpoint which is called on the cancel process button.
  2. You can change process model and encapsulate user tasks A, B with subprocess. Add message/signal catch event to the subprocess and based on this event make compensation of the current state. There are dedicated Compensation Intermediate Throwing/catching Events to manage compensations (Flowable DOCS).

Regards
Martin

Hi Martin,

thank you for your fast reply. I will try your suggestions. :slight_smile:

Greetings,
Thomas