Lukasz Kozerski [http://community.jboss.org/people/lukasz.kozerski] created the 
discussion

"Problem with starting process"

To view the discussion, visit: http://community.jboss.org/message/622346#622346

--------------------------------------------------------------
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
[http://community.jboss.org/message/622346#622346]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to