[jboss-user] [JBoss jBPM] - Wait state how to?

viniciuscarvalho do-not-reply at jboss.com
Tue Apr 3 17:23:29 EDT 2007


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034308#4034308

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034308



More information about the jboss-user mailing list