[jboss-user] [jBPM] - Re: Exception Handling in jBPM

chian do-not-reply at jboss.com
Wed Aug 1 23:40:32 EDT 2012


chian [https://community.jboss.org/people/chian] created the discussion

"Re: Exception Handling in jBPM"

To view the discussion, visit: https://community.jboss.org/message/751578#751578

--------------------------------------------------------------
Thank you for the reply.

Actually here is the scenerio..
 https://community.jboss.org/servlet/JiveServlet/showImage/2-751578-19136/processimage.jpg  https://community.jboss.org/servlet/JiveServlet/downloadImage/2-751578-19136/450-153/processimage.jpg 
Here, when *node1* throws the exception, it should traverse through transition *error*. 


*Here is the processdefinition.xml*

<?xml version="1.0" encoding="UTF-8"?>
<process-definition  xmlns="urn:jbpm.org:jpdl-3.2"  name="VitWork">
          <start-state name="Start">
                    <transition to="node1"></transition>
          </start-state>
          <node name="node1" async="true">
                    <event type="node-leave">
                              <action class="com.sample.action.MessageActionHandler1"></action>
                    </event>
                    <transition to="node2" name="ok"></transition>
                    <transition to="Error Handling" name="error"></transition>
          </node>
          <node name="node2" async="true">
                    <event type="node-leave">
                              <action class="com.sample.action.MessageActionHandler2"></action>
                    </event>
                    <transition to="Approve"></transition>
          </node>
          <task-node name="Approve">
                    <task name="Approve"></task>
                    <transition to="end"></transition>
          </task-node>
          <task-node name="Error Handling">
                    <task name="Error Handling"></task>
                    <exception-handler exception-class="java.lang.Exception">
                              <action class="com.sample.exceptionHandler.ExceptionHandler"></action>
                    </exception-handler>
                    <transition to="end-state1"></transition>
          </task-node>
          <end-state name="end"></end-state>
          <end-state name="end-state1"></end-state>
</process-definition>


*Here is the MessageActionHandler1.java*
*
*
package com.sample.action;

 import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;

public class MessageActionHandler1 implements ActionHandler {
          private static final long serialVersionUID = 1L;
          public void execute(ExecutionContext context) throws Exception {
                    System.out.println("Thread 1 going to Sleep for 15 seconds...");
                    throw new Exception("Dummy Exception"); 
          } 
}
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/751578#751578]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120801/549484e3/attachment.html 


More information about the jboss-user mailing list