1 Reply Latest reply on Jun 18, 2006 12:40 AM by hosierdm

    How Stop the Execution?

    eduardoleonhardt

      Hi Folks
      I'm using JBPM 3.0 and I'm trying to execute the follow workflow:

      <process-definition>
      <start-state name="start">
      <transition to="Task1"></transition>
      </start-state>
      <node name="Task1">
      <event type="node-enter">
      <action class="test.Task1"></action>
      </event>
      <transition to="Task2" />
      <exception-handler>
      <action class="test.Task1Undo"/>
      </exception-handler>
      </node>
      <node name="Task2">
      <event type="node-enter">
      <action class="test.Task2"></action>
      </event>
      <transition to="end" />
      <exception-handler>
      <action class="test.Task2Undo"/>
      </exception-handler>
      </node>
      <end-state name="end"></end-state>
      </process-definition>


      My problem: when test.Task1 throws any Exception I want to abort the workflow and execute the test.Task1Undo and nothing more. But the workflow continues the normal execution after test.Task1Undo, i.e. execute Task2 and goes to the "end". Can you help me to solve this? thanks a lot

        • 1. Re: How Stop the Execution?
          hosierdm

          You should read the User Guide regarding Exceptions. I believe it specifically states that exceptions do NOT influence process flow. I see that test.Task1Undo is an Exception handler implementation, but I'm not sure what you can do there to influence process flow. I do however, seem to recall the User Guide pointing out that your code can put the Token in any arbitrary node in the process. Check the User Guide and try this out; in your exception handler try putting the Token in the end state at the end of your undo code. How to do that is up to you to figure out or for someone else to tell you, because I've never done it. Let us know if that works (I might have a need for the same thing in the near future). Thanks.