5 Replies Latest reply on May 7, 2010 10:18 PM by HuiSheng Xu

    Why does my Fork end 3 times instead of 2 (in jBPM 4.3)?

    Johan Dykström Newbie

      Hi all,

      I have a process with some forks and joins, and some custom activities in it. My problem is that one of the forks, which has two outgoing transitions, ends three times, and therefore continues execution twice in one of the transitions. Nothing is executed in parallel, everything is executed in the main thread, triggered by signals from the JUnit test case.

       

      In the real application, each custom activity will trigger a long-running calculation in another JVM, and then wait for a signal. The other JVM will reply by JMS to a callback listener, which will in turn signal to the execution engine. In the attached test case, the custom activities just print a line before waiting, and the test case simulates the callbacks by sleeping for a while before sending a signal.

       

      The interesting part of the log file (also attached) is this:

       

      13:49:41,069 : Fork2 starting  : execution = ForkTest.7.10        : thread = main
      13:49:41,101 : Fork2 ending    : execution = ForkTest.7.11        : thread = main   <--- 1
      13:49:41,101 : Join1 starting  : execution = ForkTest.7.11        : thread = main
      13:49:41,101 : Fork2 ending    : execution = ForkTest.7.12        : thread = main   <--- 2
      13:49:41,101 : Join2 starting  : execution = ForkTest.7.12        : thread = main
      13:49:41,101 : Fork2 ending    : execution = ForkTest.7.10        : thread = main   <--- 3
      13:49:41,101 : Join1 starting  : execution = ForkTest.7.10        : thread = main

      Rather strange considering the definition of the fork in the process:

       

      <fork g="213,346,48,48" name="Fork2">
          <on event="start"><event-listener/></on>
          <on event="end"><event-listener/></on>
          <transition to="Join1"/>
          <transition to="Join2"/>
      </fork>

      The versions I use are:

       

      JDK 1.6.0

      jBPM 4.3

      HSQL 1.8.0

       

      I hope someone can help me with this problem!

       

      Regards, Johan