2 Replies Latest reply on Apr 2, 2008 6:17 AM by dleerob

    Re-Execute a Node's Action handler after an Exception

    dleerob

      Hi,

      If you have a Node, which assigns a Java handler called 'MyAction':

      <node name="Store Document">
       <action name="Store Document Action" class="MyAction"></action>
       <transition to="Complete"></transition>
       </node>


      If the handler 'MyAction' throws an exception (perhaps a database it needed to query was down), execution of the flow will stop at that node. How do we re-execute that node using the API's once we have fixed the problem (brought the database up).

      I tried just signalling the token (ie. token.signal()), but that doesn't re-execute 'MyAction', it just moves the token along to the next node.

      Thanks.

        • 1. Re: Re-Execute a Node's Action handler after an Exception
          kukeltje

          in what node is the token after the error? the 'store document' node or a previous one?

          Can you create a unit test with embedded actionhandler (innerclass) and an example processdefinition also embedded as a string?

          • 2. Re: Re-Execute a Node's Action handler after an Exception
            dleerob

            Thanks for the response.

            It would still be in the 'Store Document' node.

            Not to worry, I managed to find a solution:

            I simply get the Token, and execute the following code:

            Node node = token.getNode();
            ExecutionContext executionContext = new ExecutionContext(token);
            node.execute(executionContext);
            


            The action is then executed again.
            Any feedback is welcome. Hopefully this is the correct way of doing it.

            Thanks.