Fix: Handling error situation in multi-instance call activities when in async completion job #3264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The flowable-engine dispatches a JOB_EXECUTION_FAILURE event when an exception is thrown during the EndExecutionOperation of a process instance. The failing job is converted to a DeadLetterJob.
We use a CallActivity to trigger (one or multiple) SubProcess instance(s). We have an event listener which handles failing subprocess instances.
We discovered that the context of the JOB_EXECUTION_FAILURE event is set differently depending on the asyncComplete flag of the CallActivity:
From our perspective the JOB_EXECUTION_FAILURE event should always be dispatched in the context of the execution which caused the exception.
Currently this is the case for CallActivity triggered with asyncComplete=false, but not for asyncComplete=true.
Following PR corrects this behaviour.
Please let us know your opinion/feedback. Based on this we will finalise this PR.