JBoss Community

createProcessInstance + startProcessInstance does not update processinstanceinfo state

created by Affan Dar in jBPM - View the full discussion

I am seeing a strange issue in my jbpm 5 + hibernate + mysql configuration.

 

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.

 

Thanks

Reply to this message by going to Community

Start a new discussion in jBPM at Community