*/
public void executeModelObject(ModelObject mo, EngineExecutor ee)
{
TokenContext context = ee.getTokenContext();
NodeSocket entrySocket = context.getCurrentSocket();
JoinNode node = (JoinNode) entrySocket.getNode();
NodeSocket nextSocket = null;
TokenContext parentContext = context.getParentContext();
if (parentContext != null)
{
// Our token ends here
context.setLifecycleRequest(LifecycleRequest.STOP);
NodeSocket parentNextSocket = null;
if (parentContext.hasChildContext())
{
parentNextSocket = getEngine().resolveSocketRef(CoreConstants.INCOMPLETE_SOCKET_NAME, entrySocket, parentContext, false);
}
else
{
parentNextSocket = getEngine().resolveSocketRef(CoreConstants.SOCKET_OUT, entrySocket, parentContext, true);
}
if (parentNextSocket != null)
{
// Copy the data of the node entry socket in the current context
// to the exit socket in the child context.
EngineUtil.copySocketData(entrySocket, context, parentNextSocket, parentContext);
// Continue the parent context in a new thread
parentContext.setCurrentSocket(parentNextSocket);
parentContext.setLifecycleRequest(LifecycleRequest.RESUME);
TokenContextService contextService = getEngine().getTokenContextService();
contextService.saveContext(parentContext);
}
}
else
{
nextSocket = node.getDefaultExitSocket();
}
// Join implicitely commits the transaction
if (nextSocket != null)
{