2 Replies Latest reply on Jan 11, 2010 6:32 AM by gil goldman

    async frok with java actions (4.2)

    gil goldman Newbie

      hello.

      i have a simple process executing an async fork much like in the examples project.

      i want to get 2 java actions splitting from the fork to execute concurrently and both to return a String value to the process in variables named v1 and v2.

      when the execution arrives the join i get StaleObjectStateException : Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect).

       

      <process name="AsyncFork" xmlns="http://jbpm.org/4.2/jpdl">

       

          <start g="22,69,80,40">
               <transition to="fork"/>
           </start>

       

          <fork g="99,68,80,40" name="fork">
             <on continue="exclusive" event="end"/>
          <transition g="122,41:" to="ship goods"/>
          <transition g="123,142:" to="sendbill"/>
           </fork>

       

          <java class="org.jbpm.examples.async.fork.Application" g="159,17,98,50" method="shipGoods" name="ship goods" var="v2">
              <transition g="297,42:"to="join"/>
           </java>

       

        <java class="org.jbpm.examples.async.fork.Application" g="159,117,98,50" method="sendBill" name="send bill" var="v1">
          <transition g="297,141:"to="join"/>
         </java>

       

        <join g="274,66,80,40" name="join">
            <transition name="to end" to="end" g="-41,-21"/>
         </join>
         
        <end g="516,64,48,48" name="end"/>

       

      </process>

       

      i tried this with lockmode read/write/none/upgrade and also replaced the db to mysql (that supports upgrade and write as hsqldb does not).

      whati found out is that this only happens if the java actions create new varablesto the process scope on return, i.e if v1 and v2 exists before the fork itworks fine.

      my question is what is the right to implement an async fork with return values in the java actions after the fork ? or is there a bug there ?

         Thanks for your help.

           gil.