1 Reply Latest reply on Aug 30, 2006 7:36 PM by obrand

    before-signal and node-enter action question

    obrand

      New to jBPM and canoot understand within a simple test what is the difference between the before-signal and the node-enter as both reacts the same way.
      Actually the after-signal is doing the same that before-signal as well.

      The code snippet for the process is:














      And the Test is:

      ProcessInstance process = new ProcessInstance(definition);

      assertEquals("Process in start mode", process.getRootToken().getNode().getName(), "start");


      process.signal();
      logger.info((String)process.getContextInstance().getVariable("devInfo2"));
      assertEquals("Process in auction mode", process.getRootToken().getNode().getName(), "auction");

      logger.info((String)process.getContextInstance().getVariable("devInfo"));
      process.signal();
      logger.info((String)process.getContextInstance().getVariable("devInfo3"));


      devInfo is null on this test whereas placed after the next signal(), it prints the right content.

      Could someone explains me the execution model associated with the action types?

      Thanks

      Olivier

        • 1. Re: before-signal and node-enter action question
          obrand

           

          "obrand" wrote:
          New to jBPM and canoot understand within a simple test what is the difference between the before-signal and the node-enter as both reacts the same way.
          Actually the after-signal is doing the same that before-signal as well.

          The code snippet for the process is:

          <state name="auction">
           <event type="before-signal">
           <action name="devInfo" class="com.fota.action.DevInfoActionHandler"></action>
           </event>
           <event type="node-enter">
           <action name="devInfo2" class="com.fota.action.DevInfoActionHandler2"></action>
           </event>
           <event type="after-signal">
           <action name="devInfo3" class="com.fota.action.DevInfoActionHandler3"></action>
           </event>
           <transition name="to_end" to="end"></transition>
           </state>

          And the Test is:

          ProcessInstance process = new ProcessInstance(definition);
          
           assertEquals("Process in start mode", process.getRootToken().getNode().getName(), "start");
          
          
           process.signal();
           logger.info((String)process.getContextInstance().getVariable("devInfo2"));
           assertEquals("Process in auction mode", process.getRootToken().getNode().getName(), "auction");
          
           logger.info((String)process.getContextInstance().getVariable("devInfo"));
           process.signal();
           logger.info((String)process.getContextInstance().getVariable("devInfo3"));



          devInfo is null on this test whereas placed after the next signal(), it prints the right content.

          Could someone explains me the execution model associated with the action types?

          Thanks

          Olivier