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

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


   *
   * @return The new {@link ActivityNode}
   */
  public Node toNode(ProcessItem process, int syncFlags)
  {
    ActivityNode result = new ActivityNodeImpl();

    result.setProcess(process);
    result.copyFromItem(this, syncFlags);

    return result;
  }
View Full Code Here


   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();
    ActivityNode node = (ActivityNode) entrySocket.getNode();

    NodeSocket nextSocket = node.getDefaultExitSocket();

    // Activity reference missing, try the node's handler
    TokenContext oldContext = context;
    HandlerContext hc = getEngine().executeHandler(node.getActivityHandlerDefinition(), HandlerTypes.ACTIVITY, context, context.getCurrentSocket(), nextSocket);
    if (hc != null)
    {
      context = hc.getTokenContext();
      if (context != oldContext)
      {
        // Token context instance has changed due to rollback
        ee.setTokenContext(context);
      }

      nextSocket = hc.getNextSocket();
      if (nextSocket == null)
      {
        String msg = LogUtil.error(getClass(), "Handler of node $0 has set a null next socket. [{1}]", node.getQualifier(), context);
        throw new EngineException("MissingNextSocket", msg);
      }
    }
    else
    {
      // No handler present, try the default socket
      if (nextSocket != null)
      {
        LogUtil.warn(getClass(), "No activity handler defined for activity node $0, using default exit socket $1.", node.getQualifier(), nextSocket.getName());
      }
      else
      {
        String msg = LogUtil.error(getClass(), "No activity handler found for activity node $0 and no default socket present. [{1}]", node.getQualifier(), context);
        throw new EngineException("NoDefaultExitSocket", msg);
      }
    }

    context.setCurrentSocket(nextSocket);
View Full Code Here

        item = (Item) ie.getSafeTransferData(ClientFlavors.ITEM);
      }
      else if (ie.isDataFlavorSupported(ClientFlavors.ACTIVITY_NODE))
      {
        // Activity node
        ActivityNode activityNode = (ActivityNode) ie.getSafeTransferData(ClientFlavors.ACTIVITY_NODE);

        // Create a dummy item, which can hold the activity handler definition,
        // so we can start the activity handler source code generator.
        item = new JavaActivityItemImpl();
        item.setModel(activityNode.getOwningModel());

        // Copy the properties of the handler definition from the node to the dummy item
        int syncFlags = ItemSynchronization.SYNC_ALL;
        ((ItemProvider) activityNode).copyToItem(item, syncFlags);
      }
View Full Code Here

TOP

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

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.