How can I do somehting after all Task ending?

I want do something when the whole process ending (every task finished)

In current,I have a listener in the end event (ProcessEndListener implements ExecutionListener), I expect that when i call TaskService.completeWithVariablesInReturn() in the last UserTask Node and when the UserTask business logic finished,and then the ProcessEndListener executed (the notify method)!

But,actually,the notify method executed and finished while the last UserTask complete() logic is not ending!!!

I have tried in 7.19 and 7.20, but result is the same:End Event end first before the last UserTask

How can I do something after all the Task ending?

Thanks!

1 Like

BTW,no asynchronous operations in the last UserTask complete logic,no any Asynchronous continuations (before or after) in the BPMN model element

Hi @hopana,

you can add an execution listener on the process level: Delegation Code | docs.camunda.org

Here you can invoke code, when the process instance is ended.

Hope this helps, Ingo

1 Like

In C7, the engine will try to continue running on a set of tasks as long as it can.

Try putting Async before on the End event in the BPMN. You should see the User Task portions fully complete before the End-Event listener is started.

1 Like

It work! so far!
I will do more test to confirm that.

I has spent a lot of time these days to solve it!
thank you very much! :handshake: :handshake: :handshake: @GotnOGuts

thanks! @GotnOGuts solve my problem!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.