-
1. Re: Problem with starting process
salaboy21 Aug 23, 2011 8:44 PM (in response to lukasz.kozerski)The update method is executed first because you are creating the instance without starting the process. That means that the instance is created in the database and later is started.
If you signal an event you are not completing the work item, and because you don't share how your process looks like it's almost imposible for us to understand where your process is stopped.
Cheers.
-
2. Re: Problem with starting process
lukasz.kozerski Aug 24, 2011 2:58 AM (in response to salaboy21)The process is as simple as can be:
Start -> Simple script -> WorkItem -> Simple script -> End.
As you mentioned I'm not completing work item.
In my opinion the problem is that state of the process is not persisted when work item waits to complete.
-
3. Re: Problem with starting process
lukasz.kozerski Aug 24, 2011 3:21 AM (in response to salaboy21)Please consider attached example (http://community.jboss.org/servlet/JiveServlet/download/622346-39304/drools-serialization-test.zip).
There is one test method:
luk.SerializationTest.shouldSerializeVariable()
Right now it works fine. Script1 prints Foo: A, X and Script2 prints Foo: A, Y.
But if we change method of starting process from this:
ksession.startProcess("process", parameters);
// ProcessInstance process = ksession.createProcessInstance("process",
// parameters);
// long processId = process.getId();
// ksession.startProcessInstance(processId);
to this:
// ksession.startProcess("process", parameters);
ProcessInstance process = ksession.createProcessInstance("process", parameters);
long processId = process.getId();
ksession.startProcessInstance(processId);
then Script2 isn't fired.