2 Replies Latest reply on May 4, 2010 11:55 AM by Jan Nad

    JBPM 4.3 - signalled state remains active - bug or incorrect usage?

    Jan Nad Newbie

      The same problem seems to be described here http://www.techienuggets.com/Comments?tx=100474. I've not found any other references to it (or solutions).

       

      I have the following process definition:

      TestProcess.pngWhen I signal execution in D1, D2 becomes active (as reported by findActiveActivityNames), the problem is that D1 remains active as well. Is this a bug or did I get somethig wrong? It's been suggested this might be caused by wrong fork-join nesting but this doesn't help in my case.

       

      <process name="TestProcess" xmlns="http://jbpm.org/4.3/jpdl">
         <start name="start1">
            <transition to="fork1"/>
         </start>
         <state name="A">
            <transition to="fork2"/>
         </state>
         <state name="C1">
            <transition to="C2"/>
         </state>
         <state name="C2">
            <transition to="join2"/>
         </state>
         <state name="D1">
            <transition to="D2"/>
         </state>
         <state name="D2">
            <transition to="join2"/>
         </state>
         <fork name="fork2">
            <transition to="D1"/>
            <transition to="C1"/>
         </fork>
         <end name="finihed"/>
         <fork name="fork1">
            <transition to="A"/>
            <transition to="B"/>
         </fork>
         <state name="B">
            <transition to="join1"/>
         </state>
         <join name="join2"">
            <transition to="join1"/>
         </join>
         <join name="join1">
            <transition to="E"/>
         </join>
         <state name="E">
            <transition to="end"/>
         </state>
         <end name="end"/>
      </process>


      public void test() {

              repositoryService.createDeployment()

               .addResourceFromClasspath("pmlprocesses/TestProcess.jpdl.xml")

               .deploy();
             
              ProcessInstance processInstance = executionService.startProcessInstanceByKey("TestProcess");
              String pid = processInstance.getId();

              System.out.println(processInstance.findActiveActivityNames().toString());
              String executionId = processInstance.findActiveExecutionIn("B").getId();
              processInstance = executionService.signalExecutionById(executionId);

              System.out.println(processInstance.findActiveActivityNames().toString());

             executionId = processInstance.findActiveExecutionIn("A").getId();
              processInstance = executionService.signalExecutionById(executionId);

              System.out.println(processInstance.findActiveActivityNames().toString());
              executionId = processInstance.findActiveExecutionIn("C1").getId();
              processInstance = executionService.signalExecutionById(executionId);

              System.out.println(processInstance.findActiveActivityNames().toString());
              executionId = processInstance.findActiveExecutionIn("C2").getId();
              processInstance = executionService.signalExecutionById(executionId);

              System.out.println(processInstance.findActiveActivityNames().toString());
              executionId = processInstance.findActiveExecutionIn("D1").getId();
              processInstance = executionService.signalExecutionById(executionId);

              System.out.println(processInstance.findActiveActivityNames().toString());
              executionId = processInstance.findActiveExecutionIn("D2").getId();
              processInstance = executionService.signalExecutionById(executionId);

              System.out.println(processInstance.findActiveActivityNames().toString());
              executionId = processInstance.findActiveExecutionIn("E").getId();
              processInstance = executionService.signalExecutionById(executionId);

       

              assertNull("execution "+pid+" should not exist", executionService.findExecutionById(pid));

      }

       

      Output:

      [A, B]
      [A]
      [C1, D1]
      [C2, D1]
      [D1]
      [D2, D1]
      [E, D1]

       

      The process seems to have finished execution.

       

      Thanks for any ideas.