DynamicNodeInstance dynamicNodeInstance = (DynamicNodeInstance)processInstance.getNodeInstances().iterator().next();
DynamicUtils.addDynamicSubProcess(dynamicNodeInstance, session, subProcessId , parameters);
in the executeWorkItem() of WorkItemHandler, I was able to execute a subprocess on-the-fly when the process instance enters this workitem.
But it requires that this workitem is inside a dynamic node, in my case, it is ad-hoc subprocess.
My question is, without using the ad-hoc subprocess, how could I add the dynamic subprocess to current workitem?
Retrieving data ...