cancel
Showing results for 
Search instead for 
Did you mean: 

When startProcessInstanceByKey gives the instance back ?

vire7777
Champ in-the-making
Champ in-the-making
Hi all Smiley Happy

A little question but SO important for me.
I ve created a workflow instance launcher with the code :

ProcessInstance instance = runtimeService.startProcessInstanceByKey(processKey);

But something strange about that !
In my workflow, i have two javaservicetask then a human task and i ve seen that the code above gives me the instance back ONLY when it reaches the human task.

In the documentation, there s something about that :

It's important to note that the Activiti engine will continue process execution steps until it reaches a wait state, such as the user task. At such a wait state, the current state of the process instance is stored in the database. It remains in that state until a user decides to complete its task. At that point, the engine will continue until it reaches a new wait state or the end of the process. When the engine reboots or crashes in the meantime, the state of the process is safe and well in the database.


But could i do something for having it directly after the instance launch because i need it before the instance reaches the first javaservice task.

Thanks for your time and answers
11 REPLIES 11

vire7777
Champ in-the-making
Champ in-the-making
I thought the job executor was created with the creation of the process engine instance, not at the xml deployment
Anyway, i ll do a test

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
The explorer also has a process engine…