0 Replies Latest reply on Dec 7, 2010 6:41 PM by Buat Apa

    How to revisit an old state in jbpm 3.2.8?

    Buat Apa Newbie

      I tried the followings using jbpm 3.2.8. When I end with "no", which should go back to the previous state (submitForm), but I got the following errors occasionally. Did I do something wrong, or what is the right way?

       

       

       

       

       

      Caused by:

       

      java.util.ConcurrentModificationException

      at java.util.HashMap$HashIterator.nextEntry(

       

      HashMap.java:793

      )

      at java.util.HashMap$KeyIterator.next(

       

      HashMap.java:828

      )

      at org.hibernate.collection.AbstractPersistentCollection$IteratorProxy.next(

       

      AbstractPersistentCollection.java:555

      )

       

      java code (I am in open approveForm state)

       

       

       

       

       

       

       

       

       

      Collection taskList = processInstance.getTaskMgmtInstance().getTaskInstances();

      Iterator<?> iter = taskList.iterator();

       

       

       

      while (iter.hasNext()) {

             TaskInstance taskInstance = (TaskInstance) iter.next();

       

       

              if (taskInstance.isOpen()) {

       

       

                     taskInstance.end(approve ?

      "yes" :"no");

              }

      }

       

      ......

       

      process definition code

       

       

      <start-state name="start">
        <transition to="submitForm"></transition>
      </start-state>


      <task-node name="submitForm">
        <task name="submitForm">
         <assignment actor-id="submitter"></assignment>
        </task>
        <transition to="approveForm"></transition>
      </task-node>

      <task-node name="approveForm">
        <task name="approveForm">
         <assignment actor-id="approver"></assignment>
        </task>
        <transition to="end" name="yes"></transition>
        <transition to="submitForm" name="no"></transition>
      </task-node>

      <end-state name="end">
      </end-state>