[jbpm-dev] [Design of JBoss jBPM] - JBPM4 defining exception handler to redirect the sequence fl

galanfish do-not-reply at jboss.com
Mon May 11 01:42:30 EDT 2009


hi, everybody
i've defined an exceptionHandler which was supposed to affect the propagation of the execution, once the matched exception occur,
the exceptionHandler will redirect the normal sequence flow by choosing another non-default transition.
the definition is like this: ExceptionHahndlerImpl#createEventListenerReference, #setTransitionName, ActivityImpl#addExceptionHandler, etc.
but the execution didn't go right, the atomicOperations did have been added, but the execution keep propagating with the default transition, the execution didn't return to execute another ActomicOperation but call proceed()
then i modified the code in ExceptionHandlerImpl as follow, it seems work:

ExceptionHandlerImpl#executeHandler(ExecutionImpl execution, Exception exception)
if (activity!=null) {
  |         TransitionImpl transition = activity.findOutgoingTransition(transitionName);
  |         if (transition!=null) {
  |           log.trace(toString()+" takes transition "+transitionName);
  |           execution.setTransition(transition);
  |           
  |           // modification begins
  |           execution.propagation = Propagation.EXPLICIT;
  |           execution.setTransitionOrigin(activity);
  |           // modification ends
  |           
  |           execution.performAtomicOperationSync(ExecutionImpl.TAKE_TRANSITION);
  |         } else {
  |           log.info("WARNING: "+toString()+" couldn't find transition "+transitionName+" on "+activity);
  |         }
  |       } else {
  |         log.info("WARNING: "+toString()+" couldn't find current activity to take transition "+transitionName);
  |       }

is that a bug or that there are something wrong with my testcase, help please, appreciate!



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4229932#4229932

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4229932



More information about the jbpm-dev mailing list