7 Replies Latest reply on Jan 29, 2010 1:59 AM by Johan Kumps

    Async continuation in decision activity

    Johan Kumps Newbie

      Hi all,

       

      I want to use an asynchrounous continuation in my JBpm process. Please consider following piece of my process definition :

       

      ...

      <start g="10,162,80,40">
           <transition to="ChooseWorker"/>
      </start>

       

      <decision g="132,161,80,40" name="ChooseWorker">
            <handler class="be.myorganisation.myapp.WorkerDecisionHandler"/>
           <transition g="-6,-18" name="group-one" to="inTreatmentByGroupOne"/>          
           <transition g="-42,-17" name="group-two" to="inTreatmentByGroupTwo"/>          
      </decision>

      ...

       

      The WorkerDecisionHandler is implemented using Drools.

       

      When an instance is of this process is being created I want it to run the WorkerDecisionHandler in a separate thread. So I configured it as follows :

       

      ...
      <decision g="132,161,80,40" name="ChooseWorker" continue="async">
            <handler class="be.myorganisation.myapp.WorkerDecisionHandler"/>
           <transition g="-6,-18" name="group-one" to="inTreatmentByGroupOne"/>          
           <transition g="-42,-17" name="group-two" to="inTreatmentByGroupTwo"/>          
      </decision>
      ...

       

      When trying it using a unit test I think no separate thread is used to run the WorkerDecisionHandler in. I print the Thread.currentThread() in my test class and in the WorkerDecisionHandler and these are the same. What am I doing wrong?


      T in Test : hread[main,5,main]

      T in WorkerDecisionHandler : Thread[main,5,main]

       

      Kind regards,