Examples of ActivitySocket


Examples of org.openbp.core.model.item.activity.ActivitySocket

    ProcessUtil.setupProcessStandardConfiguration(process);
  }

  private static void setupActionStandardConfiguration(ActivityItem item)
  {
    ActivitySocket socket = new ActivitySocketImpl();
    socket.setName(CoreConstants.SOCKET_IN);
    socket.setEntrySocket(true);
    socket.setDefaultSocket(true);
    item.addSocket(socket);

    socket = new ActivitySocketImpl();
    socket.setName(CoreConstants.SOCKET_OUT);
    socket.setEntrySocket(false);
    socket.setDefaultSocket(true);
    item.addSocket(socket);
  }
View Full Code Here

Examples of org.openbp.core.model.item.activity.ActivitySocket

      HashMap definedParams = new HashMap();

      int n = socketList.size();
      for (int i = 0; i < n; ++i)
      {
        ActivitySocket socket = (ActivitySocket) socketList.get(i);

        StringBuffer cm = socket.isEntrySocket() ? inputComment : outputComment;

        String socketName = socket.getName();
        String socketIdent = StandardSocketNames.getStandardSocketNameIdentifier(socketName);

        if (socketIdent == null)
        {
          // Add a string constant definition for this socket name to the 'constants' placeholder
          socketIdent = makeSocketName(socketName);
          String type = socket.isEntrySocket() ? "Input" : "Output";
          w.addToPlaceholder("socketConstants", "/** " + type + " socket " + socketName + " */");
          w.addToPlaceholder("socketConstants", "private static final String " + socketIdent + " = \"" + socketName + "\";");
          w.addToPlaceholder("socketConstants", "");
        }

        if (!socket.isEntrySocket() && socket.isDefaultSocket())
        {
          standardExitSocket = socketIdent;
        }

        cm.append("  Socket '");
        cm.append(socketName);
        cm.append("'");

        String dn = socket.getDisplayName();
        if (dn != null)
        {
          cm.append(": ");
          cm.append(dn);
        }
        cm.append("\n");

        List paramList = socket.getParamList();
        if (paramList != null)
        {
          int np = paramList.size();
          for (int ip = 0; ip < np; ++ip)
          {
            ActivityParam param = (ActivityParam) paramList.get(ip);

            String paramName = param.getName();
            String paramIdent = makeParamName(paramName);

            if (!definedParams.containsKey(paramName))
            {
              definedParams.put(paramName, Boolean.TRUE);
              w.addToPlaceholder("paramConstants", "/** Parameter " + paramName + " */");
              w.addToPlaceholder("paramConstants", "private static final String " + paramIdent + " = \"" + paramName + "\";");
              w.addToPlaceholder("paramConstants", "");
            }

            cm.append("    Parameter '");
            cm.append(paramName);
            cm.append("'");
            dn = param.getDisplayName();
            if (dn != null)
            {
              cm.append(": ");
              cm.append(dn);
            }
            cm.append("\n");

            DataTypeItem type = param.getDataType();
            if (type != null)
            {
              String className = type.getClassName();
              if (className == null)
                className = "Object";
              String typeName = extractUnqualifiedName(w, className);

              String paramVariableName = NameUtil.makeMemberName(paramName);

              if (socket.isEntrySocket())
              {
                if (w.isPlaceholderEmpty("inputParamAccess"))
                {
                  w.addToPlaceholder("inputParamAccess", "/* Input parameter access code");
                }
View Full Code Here

Examples of org.openbp.core.model.item.activity.ActivitySocket

   */
  public static boolean makeSocket(ActivityItem item, String socketName, int flags, ActivityParam [] newParamList)
  {
    boolean update = false;

    ActivitySocket socket = item.getSocketByName(socketName);
    if (socket == null)
    {
      socket = new ActivitySocketImpl();
      socket.setName(socketName);
      item.addSocket(socket);
      update = true;
    }

    boolean entrySocket = (flags & MAKESOCKET_ENTRY) != 0;
    boolean defaultSocket = (flags & MAKESOCKET_DEFAULT) != 0;
    boolean arrangeSocket = (flags & MAKESOCKET_ARRANGE) != 0;

    if (socket.isEntrySocket() != entrySocket)
    {
      socket.setEntrySocket(entrySocket);
      update = true;
    }

    if (socket.isDefaultSocket() != defaultSocket)
    {
      socket.setDefaultSocket(defaultSocket);
      update = true;
    }

    if (arrangeSocket && socket.getGeometry() != null)
    {
      socket.setGeometry(null);
    }

    if (newParamList != null)
    {
      for (int i = 0; i < newParamList.length; ++i)
      {
        ActivityParam newParam = newParamList [i];
        ActivityParam param = socket.getParamByName(newParam.getName());
        if (param != null)
        {
          // Parameter exists, update the data type if necessary
          if (param.getDataType() != newParam.getDataType())
          {
            param.setDataType(newParam.getDataType());
            update = true;
          }
        }
        else
        {
          // Parameter does not exist yet, add it
          socket.addParam(newParam);
          update = true;
        }
      }
    }

View Full Code Here

Examples of org.openbp.core.model.item.activity.ActivitySocket

   *    true  The socket was removed
   *    false  No change to the socket was made
   */
  public static boolean removeSocket(ActivityItem item, String socketName)
  {
    ActivitySocket socket = item.getSocketByName(socketName);
    if (socket != null)
    {
      item.removeSocket(socket);
      return true;
    }
View Full Code Here

Examples of org.openbp.core.model.item.activity.ActivitySocket

    // Copy the sockets
    clearSockets();
    for (Iterator it = ai.getSockets(); it.hasNext();)
    {
      ActivitySocket activitySocket = (ActivitySocket) it.next();

      NodeSocket nodeSocket = new NodeSocketImpl();
      nodeSocket.copyFromActivitySocket(activitySocket, syncFlags);
      addSocket(nodeSocket);
    }
View Full Code Here

Examples of org.openbp.core.model.item.activity.ActivitySocket

    ai.clearSockets();
    for (Iterator it = getSockets(); it.hasNext();)
    {
      NodeSocket nodeSocket = (NodeSocket) it.next();

      ActivitySocket activitySocket = new ActivitySocketImpl();
      nodeSocket.copyToActivitySocket(activitySocket, syncFlags);
      ai.addSocket(activitySocket);
    }

    ai.setGeometry(getGeometry());
View Full Code Here

Examples of org.openbp.core.model.item.activity.ActivitySocket

    // Copy the sockets
    clearSockets();
    for (Iterator it = ai.getSockets(); it.hasNext();)
    {
      ActivitySocket activitySocket = (ActivitySocket) it.next();

      NodeSocket nodeSocket = new NodeSocketImpl();
      nodeSocket.copyFromActivitySocket(activitySocket, syncFlags);
      addSocket(nodeSocket);
    }
View Full Code Here

Examples of org.openbp.core.model.item.activity.ActivitySocket

    ai.clearSockets();
    for (Iterator it = getSockets(); it.hasNext();)
    {
      NodeSocket nodeSocket = (NodeSocket) it.next();

      ActivitySocket activitySocket = new ActivitySocketImpl();
      nodeSocket.copyToActivitySocket(activitySocket, syncFlags);
      ai.addSocket(activitySocket);
    }

    ai.setGeometry(getGeometry());
View Full Code Here

Examples of org.openbp.core.model.item.activity.ActivitySocket

    {
      ActivityItem activity = (ActivityItem) activityItems.next();
      Iterator sockets = activity.getSockets();
      while (sockets.hasNext())
      {
        ActivitySocket activitySocket = (ActivitySocket) sockets.next();
        foundModelObjects.addAll(findInActivitySocket(activitySocket, item));
      }
    }

    // Now search the datatypes itself, e.g. complex data types
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.