Package org.openbp.core.model.item.process

Examples of org.openbp.core.model.item.process.JoinNode


   */
  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)
    {
View Full Code Here

TOP

Related Classes of org.openbp.core.model.item.process.JoinNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.