0 Replies Latest reply on Mar 3, 2009 11:44 PM by jeffery c

    nested branch problems

    jeffery c Newbie

      hi all,

      i've defined a process like this:

      A_a ------------------------------\
      / \
      start(waitstate) -> main_fork main_join -> end
      \ /
      \ B_C_a /
      \ / \ /
      B_a -> B_fork B_join
      \ /

      fork and join activity are using the classes of 'org.jbpm.jpdl.internal.activity.ForkActivity' and 'org.jbpm.jpdl.internal.activity.JoinActivity'

      ClientProcessDefinition process = ProcessDefinitionBuilder.startProcess("simpleNestedBranch")
       .startActivity("start", WaitState.class)
       .transition("main_fork", "to_main_fork")
       .startActivity("main_fork", ForkActivity.class)
       .transition("A_a", "to_A_a")
       .transition("B_a", "to_B_a")
       .startActivity("A_a", AutomaticActivity.class)
       .transition("main_join", "to_main_join")
       .startActivity("B_a", AutomaticActivity.class)
       .transition("B_fork", "to_B_fork")
       .startActivity("B_fork", ForkActivity.class)
       .transition("B_C_a", "to_B_C_a")
       .transition("B_D_a", "to_B_D_a")
       .startActivity("B_C_a", AutomaticActivity.class)
       .transition("B_join", "to_B_join")
       .startActivity("B_D_a", AutomaticActivity.class)
       .transition("B_join", "to_B_join")
       .startActivity("B_join", JoinActivity.class)
       .transition("main_join", "to_main_join")
       .startActivity("main_join", JoinActivity.class)
       .transition("end", "to_end")
       .startActivity("end", EndState.class) // EndState: implementation of ActivityBehaviour, call execution#end in the #execute

      then i deploy and run the testcase with

      executionService.startProcessInstanceById("simpleNestedBranch:1", "yyyy2");
       executionService.signalExecutionById("simpleNestedBranch/yyyy2", "to_main_fork");

      the result is not as i expected.
      the console print out by this order:

      start -> main_fork (execution id: simpleNestedBranch/yyyy2)
      -> A_a -> main_join (execution id: simpleNestedBranch/yyyy2/to_A_a)
      -> B_a -> B_fork (execution id: simpleNestedBranch/yyyy2/to_B_a)
      -> B_C_a -> B_join (execution id: simpleNestedBranch/yyyy2/to_B_C_a)
      -> B_D_a -> B_join (execution id: simpleNestedBranch/yyyy2/to_B_D_a)
      -> main_join (execution id: simpleNestedBranch/yyyy2/48)
      -> end (execution id: simpleNestedBranch/yyyy2/49)
      -> B_C_a -> B_join (execution id: simpleNestedBranch/yyyy2/to_B_a)

      then i checked the table 'jbpm_execution' in database, the recrods like this:
      dbid dbversion act name key id state
      47 2 null null yyyy2 simpleNestedBranch/yyyy2 inactive
      48 1 69(main_join) null null simpleNestedBranch/yyyy2/48 ended
      49 1 70(end) null null simpleNestedBranch/yyyy2/49 ended
      50 0 74(B_join) to_B_a null simpleNestedBranch/yyyy2/to_B_a inactive

      the process does not ended as i expected, i suppose that the process would be ended when the activity 'end' finished.
      need some help... any suggestion would be appreciate!!