[jboss-user] [JBoss jBPM] - Possible bug in fork-joins

gmournos do-not-reply at jboss.com
Tue Sep 5 11:28:34 EDT 2006


I have a process definition where there is a join of 3 input tokens. It seems that the join consumes only the two of the tokens and gets passed. Is this a bug ?

The code is the following:
  public static ProcessDefinition createForkJoinProcessDefinition() {
  |     ProcessDefinition pd = new ProcessDefinition(
  |       new String[]{"start-state start",
  |                    "fork f1",
  |                    "state s1",
  |                    "fork f2",
  |                    "state s2",
  |                    "join j1",
  |                    "state s3",
  |                    "end-state end"},
  |       new String[]{"start --> f1", "f1 --to_s1--> s1", "f1 --to_j1_1--> j1",
  |                    "s1 --> f2", "f2 --to_j1_2--> j1", "f2 --to_s2--> s2",
  |                    "s2 --to_j1_3--> j1", "j1 --> s3", "s3 --> end"});
  |     return pd;
  |   }
  | 
  |   public void testComplex2() {
  |     ProcessDefinition pd = createForkJoinProcessDefinition();
  |     ProcessInstance pi = pd.createProcessInstance();
  |     pi.signal();
  |     Token root = pi.getRootToken();
  |     Token to_s1 = root.getChild("to_s1");
  |     Token to_j1_1 = root.getChild("to_j1_1");
  |     assertNotNull(to_s1);
  |     assertNotNull(to_j1_1);
  |     to_s1.signal();
  |     Token to_s2 = to_s1.getChild("to_s2");
  |     Token to_j1_2 = to_s1.getChild("to_j1_2");
  |     assertNotNull(to_s2);
  |     assertNotNull(to_j1_2);
  |     to_s2.signal();
  | 
  | 
  |     try {
  |       assertSame(root.getNode(), pd.getNode("s3"));
  |     } catch (junit.framework.AssertionFailedError e) {
  |       System.out.println("this is failing but should be succeding");
  |     }
  | 
  |     try {
  |       assertNotSame(to_s1.getNode(), pd.getNode("s3"));
  |     } catch (junit.framework.AssertionFailedError e) {
  |       System.out.println("This is wrong, j1 has consumed only " +
  |               "tokens to_s2 and to_j12_2. Token to_j1_1 remained unconsumed");
  |     }
  | 
  |     try {
  |       to_s1.signal();
  |       assertTrue(pi.hasEnded());
  |     } catch (junit.framework.AssertionFailedError e) {
  |       System.out.println("This is wrong, we should have finished by now");
  |     }
  | 
  |     to_j1_1.signal();
  |     to_j1_1.signal();
  |     assertTrue(pi.hasEnded());
  |     System.out.println("This is wrong, token to_j1_1 should have already been consumed by j1");
  |   }


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

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



More information about the jboss-user mailing list