Determine which end event completed the process

Hello,

I am using async request to start a bpmn process ( i am using camunda via its api - no java )
It is awaiting for the process to complete ( i am sending an inner http request to get the history of the process and check if the status is still ACTIVE every second ), once the status changes i return a response.

I covered the error handling in the BPMN process itself by using error boundary events on each task which are leading to a “Technical Error Handler” task ).

The problem is that this task completes the process as well which leads to the same “COMPLETED” status in the history, which i am getting when the process finishes without errors as well.

This is why i was wondering if there is a clean way to determine if my process ended via the “successful finish” endEvent or by the “failed finish” endEvent both of which are being counted as “COMPLETED” on the workflow history level of things.

I thought about forcing an exception on the workflow level once the “Technical Error Handler” bpmn task finishes its job, but it feels wrong.

Hi @lvgi,

What about adding an execution listener to each of the end events? That listener would set a process variable that indicates if it is a “good” or “bad” end. Then check the variable in the history once the process instance has finished.

Cheers,
Thorben

1 Like

In the end i ended up using something similar to your suggestion,

Thank you!