cancel
Showing results for 
Search instead for 
Did you mean: 

Exception handling when a parallel gateway is used

ayeshaiqbal
Champ in-the-making
Champ in-the-making
Hi,

We have a activiti workflow which is attached to this post .

We are facing problems in implementing exception handling for this workflow. Basically, each of my 3 call activities can end in error states. These error states are captured using error boundary event on the call activiti.If an error occurs in any of the call activities, parent process execution is forwarded to a compensatory task called as Rollback.In the Rollback task , we want to read which all call activities have failed and based on that rollback the changes made by those particular call activities.

Right now, in each of the individual call activities we are setting an errorCode variable in the context of the parent process.This is done using execution listeners when a path to an error end event is traversed.The code for that is as follows

((ExecutionEntity)execution).getSuperExecution().setVariable("errorCode", errorCode.getValue(execution));

The problem with this approach is that one call activiti can overwrite the errorCode value set in another call activiti since these call activities are executing in parallel.Our basic requirement is that the Rollback task should be able to read the list of errors that occurred in all the call activities combined and based on that perform the necessary rollback.Can someone in this forum please suggest a robust approach of doing exception handling in this particular case ?

We need this urgently so any help would be immensely appreciated Smiley Happy
1 REPLY 1

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
use an array as a variable and have each call activiti add its errors to that?