0 Replies Latest reply on Oct 13, 2010 5:46 AM by Abdelilah Essiari

    Questions on JBPM 4.4.

    Abdelilah Essiari Newbie

      I am evaluating JBPM 4.4 (JPDL)  for my project and I have ran into a couple of issues:

       

      One is that a mix of exclusive continuations and asynchronous continuations does not quite work.

      Upon a close look at AcquireJobsCmd.java, it becomes aparrent:

                a) more than one exclusive job can execute in different transactions.

                b) an exclusive job concurrently with an asynchrouns job is running.

       

      This defeats my understanding of what exclusive means. I have tentatively modified AcquireJobsCmd.java by ensuring

      that a and b do not happen. This is important in my case as I have an assign statement that needs to update a process

      variable inside a forEach with asynchronous java continuations as shown below. This only works after I made my changes.

       

           <variable history="false" name="GlobalMap" type="serializable">
                 <map>
                 </map>
             </variable>


            <foreach g="160,261,48,48" in="#{dataSources}" name="foreach" var="dataSource">
                 <transition  to="do lookup"/>
             </foreach>
        
             <java continue="async" class="test.JavaService" g="327,259,98,50" method="lookup" name="do lookup" var="returnVar">
                 <arg>
                     <object expr="#{dataSource}"/>
              </arg>
              <arg>
                  <string value="kw"/>
              </arg>
              <transition continue="exclusive" to="copy" />
            java>

          
          <assign from-expr="#{returnVar}" name="copy" to-expr="#{GlobalMap[dataSource]}">
              <transition to="join"/>
          </assign>
        
          <join g="567,259,80,40" multiplicity="#{dataSources.size}" name="join">
              <transition to="do materialize"/>
          </join>

            ...

       

      The other question is that returnVar is actually mapped to the parent execution. It should map to the forked execution as is the variable dataSource. Shouldn't it?

       

      In any case the tentative fix for this was easy. Just changed a one line in JavaActivity.java.

       

      if (variableName!=null) {
              //  execution.setVariable(variableName, returnValue);
             execution.createVariable(variableName, returnValue);
      }

       

      Hope to hear from someone. Thanks in advance.

       

      aes.