Hi,
I have a process which consists of multiple sub-processes. I would like to know that after deploying the processes(super as well as sub processes), is it necessary for me to set the process states with their sub-process definitions?
What I mean to say is that currently i create my process instance in the following way:
ProcessDefinition superDefinition = getProcessAdmin().getDefinition("superprocess");
ProcessDefinition subDefinition = getProcessAdmin().getDefinition("subprocess1");
//...... do the same for the remaining sub-processes
ProcessState state = (ProcessState) superDefinition.getNode("sp1");
state.setSubProcessDefinition(subDefinition);
//...... repeat the above two steps for the remaining sub-processes.
ProcessInstance instance = new ProcessInstance(superDefinition);
Then my query here is that do I have to set these sub process definitions or is there a way to configure so that when i create the super process instance and the sub-processes are picked up automatically and created?
As in is it okay just to have the following steps:
ProcessDefinition superDefinition = getProcessAdmin().getDefinition("superprocess");
ProcessInstance instance = new ProcessInstance(superDefinition);
Hope that its clear.
Thanks
AFAIK, what you are looking for is the normal behaviour that comes with jbpm out of the box.
Regards,
Koen