SubprocessNode node = (SubprocessNode) entrySocket.getNode();
// If we do not have a sub process, simply continue with the default exit socket
NodeSocket nextSocket = node.getDefaultExitSocket();
ProcessItem subprocess = node.getSubprocess();
// Dynamic sub processes:
// If we have a Process Name parameter and its value is a string...
Object result = TokenContextUtil.getParamValue(context, entrySocket, CoreConstants.DYNAMIC_SUBPROCESS_PARAM_NAME);
if (result != null && result instanceof String)
{
// ...try to lookup and return a corresponding process.
try
{
subprocess = (ProcessItem) context.getExecutingModel().resolveItemRef((String) result, ItemTypes.PROCESS);
}
catch (ModelException re)
{
// Fall thru to the default.
}
}
if (subprocess != null)
{
// The default exit socket of the initial node of the sub process
// that has the same name as the initial node of this sub process
// node is our initial socket for execution of the sub process.
String entryName = entrySocket.getName();
Node subprocessInitialNode = subprocess.getNodeByName(entryName);
if (subprocessInitialNode == null)
{
String msg = LogUtil.error(getClass(), "Initial node $0 called by $1 not found in process $2. [{3}]", entryName, node.getQualifier(), subprocess.getQualifier(), context);
throw new EngineException("InitialNodeNotFound", msg);
}
if (!(subprocessInitialNode instanceof InitialNode))
{