AnsweredAssumed Answered

Exception handling when a parallel gateway is used

Question asked by ayeshaiqbal on Sep 9, 2011
Latest reply on Sep 9, 2011 by ronald.van.kuijk

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 :)