cancel
Showing results for 
Search instead for 
Did you mean: 

how can I start process instance inside a servicetask?

jcosano
Champ in-the-making
Champ in-the-making
Inside execute method I would create a new ProcessInstance.

how can I obtain runtimeservice?

or maybe this code must be replaced by Call activity (subprocess) ???


thanks!!
2 REPLIES 2

mskaesz
Champ in-the-making
Champ in-the-making
To obtain the default process engine:

ProcessEngineImpl engine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();

To start a process:

engine.getRuntimeService().startProcessInstanceByKey("helloWorld");

I GUESS: runtimeservice is a spring bean…

Cheers
Marc

jcosano
Champ in-the-making
Champ in-the-making
Thank you!!

Is good for me!

I choose this option because I need call a subprocess but I don't need wait to subprocess finish. (call activity do it)