cancel
Showing results for 
Search instead for 
Did you mean: 

Sub-Process Async invocations

irfan_azam
Champ in-the-making
Champ in-the-making
Hi,

I want to start a process (defined in a separate diagram) as a sub-process from the main process asynchronously multiple times. Here is the sample code that I am currently trying to do.

for(Server server : servers){
         Map<String, Object> variables = new HashMap<String, Object>();
         variables.put("server", server);
         variables.put("target", arg0.getVariable("target"));
         arg0.getEngineServices().getRuntimeService().startProcessInstanceByKey("configureServerProc", variables);
      }

I want to start a "configure server process" for every server asynchronously and then yield all the results in the main process. The above code starts processes but they run synchronous. Is there a way through code or process definition to achieve the above ask?

-Irfan Azam
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

use call activity instead:
http://www.activiti.org/userguide/#bpmnCallActivity
with multiinstance:
http://www.activiti.org/userguide/#bpmnMultiInstance
(asynchronously)
Regards
Martin