I am trying to write a exception handler for a process state node. The sub 
processes may throw a variety of exceptions. These exceptions need to be caught 
when the subprocess is wrapped by another higherlevel process.  The higherlevel 
process we have the process-state node defined as:

   <process-state name="Process Target">
  |       <sub-process name="subProcess"></sub-process>   
  |                   <transition name="" to="updateStatus"></transition>
  |                   <exception-handler>
  |                       <action 
class="....StatusDetailExceptionHandler"></action>
  |                   </exception-handler>
  |    </process-state>  


However, when we try to test this in the debugger, the exception is first 
caught by the Node calling the action. It then tries to raise the exception, 
and ends up delegating to the subprocess definition, which throws a 
DelegatedException(). 
Since the ProcessState.enter() does not wrap with a Catch, the exception is 
never processed by this node this the exception goes up the stack to the 
previous Node, and its exception handler does get called. 

Potentially handling the exception in the incorrect way. 

The work around I came up with is to define a node previous to the process 
state to define the exception handling for process state. And a exception 
transistion taken by the handler.

   <node name="handleException">
  |                   <transition name="" to="subProcess"></transition>
  |                   <transition name="exception" 
to="updateStatus"></transition>
  |                   <exception-handler>
  |                             <action 
class="....StatusDetailExceptionHandler"></action>
  |                   </exception-handler>
  |    </node>
  |    <process-state name="Process Target">
  |       <sub-process name="subProcess"></sub-process>   
  |                   <transition name="" to="updateStatus"></transition>
  |                   <exception-handler>
  |                       <action 
class="....StatusDetailExceptionHandler"></action>
  |                   </exception-handler>
  |    </process-state>  


Is there any better workaround?

Kevin

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064806
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to