[jboss-user] [jBPM Users] - Re: nested forks

saraswati.santanu do-not-reply at jboss.com
Wed Nov 18 16:28:40 EST 2009


We can use our understanding about the bug to have a hack for the time being.

We see task1 twice because the transition to task1 is the default transition of the fork node. To stop task1 from appearing twice we need to make sure that it is not the default transition. Instead we can add a dummy node for default transition to make sure that the rest of the forked nodes behave properly. We can try a flow like this:


  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process name="ForumFlow2" xmlns="http://jbpm.org/4.0/jpdl">
  | 
  |    <start g="5,129,48,48" name="start1">
  |       <transition to="fork1"/>
  |    </start>
  |    <end g="957,121,48,48" name="end1"/>
  |    
  |    <task g="300,199,92,52" name="task2">
  |       <transition g="444,222:" to="join2"/>
  |    </task>
  |    <task g="334,329,92,52" name="task3">
  |       <transition g="679,358:" to="join1"/>
  |    </task>
  |    <task g="745,120,92,52" name="task8">
  |       <transition to="end1"/>
  |    </task>
  |    <task g="513,120,92,52" name="task9">
  |       <transition to="join1"/>
  |    </task>
  |    <task g="294,123,92,52" name="task1">
  |       <transition to="join2"/>
  |    </task>
  |    <fork g="211,130,48,48" name="fork2">
  |       <transition name="to java1" to="java1" g="235,68:-45,-18"/>
  |       <transition to="task1"/>
  |       <transition g="235,228:" to="task2"/>
  |    </fork>
  |    <join g="417,123,48,48" name="join2">
  |       <transition to="task9"/>
  |    </join>
  |    <join g="652,119,48,48" name="join1">
  |       <transition to="task8"/>
  |    </join>
  |    <fork g="93,126,48,48" name="fork1">
  |       <transition g="114,355:" to="task3"/>
  |       <transition to="fork2"/>
  |    </fork>
  |    <java name="java1"
  | 		 class="org.jbpm.test.DoNothingActivity"
  | 		 method="doNothing" 
  | 		 g="301,41,92,52">
  |    </java>
  | </process>
  | 

And a dummy java activity class


  | package org.jbpm.test;
  | 
  | /**
  |  * @author Santanu
  |  *
  |  */
  | public class DoNothingActivity{
  | 	
  | 	public void doNothing() {
  | 		System.out.println("Doing nothing");
  | 	}
  | 
  | }
  | 

This should give you correct list of tasks after the nested fork.


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

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



More information about the jboss-user mailing list