processModel = context.getExecutingModel();
}
if (processModel == null)
{
String msg = LogUtil.error(getClass(), "Position reference $0 requires a model specification or the executing model to be set. [{1}]", ref, context);
throw new ModelException("NoDefaultProcess", msg);
}
// Absolute reference: The process specification was given in the start reference
ProcessItem process;
if (processName != null)
{
// Resolve the process reference
process = (ProcessItem) processModel.resolveItemRef(processName, ItemTypes.PROCESS);
}
else
{
// Use the model's default process
process = processModel.getDefaultProcess();
if (process == null)
{
String msg = LogUtil.error(getClass(), "Model $0 does not have a default process (position reference: $1). [{2}]", processModel.getQualifier(), ref, context);
throw new ModelException("NoDefaultProcess", msg);
}
}
// Get the entry socket
Node node;
if (entryName != null)
{
node = process.getNodeByName(entryName);
if (node == null)
{
String msg = LogUtil.error(getClass(), "Initial node $0 not found in process $1 (position reference: $2). [{3}]", entryName, process.getQualifier(), ref, context);
throw new ModelException("NodeNotFound", msg);
}
}
else
{
node = process.getDefaultInitialNode();
if (node == null)
{
String msg = LogUtil.error(getClass(), "Process $0 does not have a default initial node (position reference: $1). [{2}]", process.getQualifier(), ref, context);
throw new ModelException("NoDefaultNode", msg);
}
}
if (! (node instanceof InitialNode))
{
String msg = LogUtil.error(getClass(), "Node $0 is not an initial node (position reference: $1). [{2}]", node.getQualifier(), ref, context);
throw new ModelException("NoInitialNode", msg);
}
NodeSocket initialSocket = ((InitialNode) node).getSocket();
if (! initialSocket.hasControlLinks())