JBoss Community

Problem with starting process

created by Lukasz Kozerski in jBPM - View the full discussion

Hi,

 

I have some problem with startring the process. Unfortunetly it is related to process persistence.

 

I have some breakpoints, here:

org.jbpm.process.instance.impl.ProcessInstanceImpl.start()

 

and here:

org.jbpm.persistence.processinstance.ProcessInstanceInfo.update()

 

When I'm starting process:

        ProcessInstance process = ksession.startProcess("process", parameters);

        ksession.insert(object);

        ksession.insert(process);

        ksession.fireAllRules();

        ksession.dispose();

 

everything seems to be ok. Breakpoints fires in correct order: start() and then update().

 

But I need to start the process like this:

        ProcessInstance process = ksession.createProcessInstance("process", parameters);

        long processId = process.getId();

        ksession.startProcessInstance(processId);

        ksession.insert(object);

        ksession.insert(process);

        ksession.fireAllRules();

        ksession.dispose();

 

In this example breakpoints fires in this order: update(), start().

 

Why this is problem?

 

If the server restarts and ProcessInstance is deserialized it has state STATE_PENDING. If now we complete some work item there is one line of code here:

org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(String, Object)

 

I looks like this:

if (getState() != ProcessInstance.STATE_ACTIVE) {

                                        return;

                              }

 

and process is not continuing.

 

What am I doing wrong?

 

Lukasz

Reply to this message by going to Community

Start a new discussion in jBPM at Community