5 Replies Latest reply on Apr 4, 2007 8:25 AM by Vinicius Carvalho

    Wait state how to?

    Vinicius Carvalho Apprentice

      Hello there! I have a simple process with few actions and one decision, one fork and one join. I can't post the actual process here due NDA but I'll change names and if needed I change the whole processdefinition and attach it here.
      My question is regarding wait states. I want to have a wait state on my process, but testing it, it runs an entire path without stopping (It does follow the correct path depending on decisions, but does not wait for other inputs). Here's how I'm testing it:

      @Before
      public void init(){
       this.processDefinition = ProcessDefinition.parseXmlInputStream(getClass().getClassLoader().getResourceAsStream("processdefinition.xml"));
      
       this.startState = (StartState) this.processDefinition.getStartState();
       this.endState = (EndState)this.processDefinition.getNode("end");
       this.processInstance = new ProcessInstance(this.processDefinition);
       this.token = processInstance.getRootToken();
      }
      @Test
       public void testMainFlow() throws Exception{
       this.token.signal();
       }
      


      My first action creates an hypothetical situation, that is latter checked in a transition:

       <start-state name="start">
       <transition name="" to="firstStep">
       <action name="action1" class="*.*.*.*.FirstNodeHandler"></action>
       </transition>
       </start-state>
      .
      .
      .
      <decision name="checkAmount">
      
       <transition name="Yes" to="Wait for approval">
       <condition><![CDATA[#{contagem < 500}]]></condition>
       </transition>
       <transition name="No" to="Approve">
       <condition><![CDATA[#{contagem > 500}]]></condition>
       </transition>
       </decision>
      


      What I'd want is the node "Wait for Approval" stay in a wait state untill other entity signals it. But it's just executing it and continuing the flow.
      What have I missed?

      Regards