I am having following BPM workflow, where multiple subprocesses are executed in parallel. I want to have single error handler that will notify about the error from each subprocess. Service task in each subprocess throws an BPMNError with same error code at different time interval.
Problem is, when the first error is encountered, the process instance ends. Is there any way so that the error event can be called multiple times without completing the entire process?
For the use case you should be using an escalation event instead of an error.
Escalations can be non-interupting.
Thanks for a quick reply.
I am actually throwing BpmnError after the retries are exhausted, as given in this code
In this case how do I throw escalation event? I do not want to repeat escalation events after each service task.
Escalation events propagate in the same way as errors, but the difference is they can be thrown without interrupting the process, they can also be thrown and caught multiple times.
But another option might be to use an error boundary event instead of an event subprocess.
then each error event would not affect the other:
please ignore this. I was able to fix it by redirecting each errorHandler task to inclusive gateway
But my main goal was to remove duplicate error handling at multiple service tasks. Is there any other way avoid this duplicate pattern?
An error event by it’s design will interrupt the child scopes when caught - so maybe you should consider using a different symbol if that isn’t what you want to do.