Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-3561

createProcess + startProcessInstance does not persist the state of the process instance correctly

XMLWordPrintable

      I am seeing a strange issue in my jbpm 5 + hibernate + mysql configuration which might be a bug.

      A test process 'com.sample.bpmn' consists of the following: start -> myactivityhandler -> somescript -> end
      myactivityhandler is an async activity handler and hence 'execute' returns without calling completeWorkItem.

      Now after execution of the following snippet:

      ..
      ksession.startProcess("com.sample.bpmn");
      ..

      I look at the ProcessInstanceInfo for the process and I see that the instance state is rightful set to ACTIVE since the process is actually active and just hit its first savepoint after the myactivityhandler.

      However if I break the startprocess down to the following:

      ..
      ProcessInstance pi = ksession.createProcessInstance("com.sample.bpmn", null);
      ksession.startProcessInstance(pi.getId());
      ..

      After execution of the above two, I expect the state would be the same as the previous snippet i.e. process instance state == ACTIVE but in reality it is set to PENDING. Also when I trace the SQL that hibernate is sending to MySQL I don't see any UPDATE going to the ProcessInstanceInfo table. This is a problem since now I can't complete the myactivityhandler workitem to continue the process.. and it needs to be started again.

      Any clue why the above two scenarios are behaving differently?

      Fwiw, if I configure the system to use the in-memory H2 then everything works fine and dandy.

              kverlaen@redhat.com Kris Verlaenen
              affandar Affan Dar (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: