cancel
Showing results for 
Search instead for 
Did you mean: 

Invocation of one process from other

suoza
Champ in-the-making
Champ in-the-making
Hi,

I want to invoke one process from other but not using the call Activity. Is is possible to use the execution or task listeners to invoke the other process using ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("<newProcessId>");

Please suggest.


Thanks
Sunil Oza
System Analyst
3 REPLIES 3

fellowtom
Champ in-the-making
Champ in-the-making
Hi suoza,

as far as i know you can use the delegateTask when using a TaskListener(usertask) or the execution when using the JavaDelegate(servicetask).
delegateTask.getExecution().getEngineServices().getRuntimeService().startProcessInstanceByKey(arg0); (almost the same for execution). More information on http://www.jorambarrez.be/blog/2012/10/25/call-a-service-in-a-service-tas/.
Hope this is correct and helps.

Greetings,
Tom

suoza
Champ in-the-making
Champ in-the-making
Ok..
Is it also possible that when i invoke a process from the other sing the delegateTask.getExecution().getEngineServices().getRuntimeService().startProcessInstanceByKey(arg0) can i get the data or process variables form the calling process..

If yes can you suggest a way. Also this is only in case of Service task where we can configure a java class to be invoked.

Can we do the same using listeners on Script task or user task.

Also is it possible we can invoke a process's particular task.

For example in Process1 we have a Script task and User task and from User task we invoke a process 2.
In process 2 we have User task, Script task and Service task.
Can we invoke process2's Script task directly from user task of process 1.

Please suggest how this can be done.

trademak
Star Contributor
Star Contributor
You can start the new process instance with the variables you want to pass on from the calling process context. Just pass a Map of variables with the startProcessInstanceByKey method. Yes you can also do this from a listener. No you can't invoke a specific element in another process definition. You can only start a new process instance.

Best regards,