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

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


        else if (next instanceof ParamFigure)
        {
          ParamFigure paramFigure = (ParamFigure) next;

          NodeParam param = paramFigure.getNodeParam();

          if (paramHolder == null)
          {
            if (socketHolder == null)
            {
              socketHolder = new ActivityNodeImpl();
              socketHolder.setName("NodeDummy");
              process.addNode(socketHolder);
            }

            paramHolder = new NodeSocketImpl();
            paramHolder.setName("SocketDummy");
            socketHolder.addSocket(paramHolder);
          }

          // Clone the socket and add it to the dummy node
          param = (NodeParam) param.clone();
          paramHolder.addParam(param, - 1);

          copyFlavor = ClientFlavors.NODE_PARAMS;
        }
      }
View Full Code Here


          NodeSocket socket = (NodeSocket) node.getSocketList().get(0);
          List params = socket.getParamList();
          int n = params.size();
          for (int i = 0; i < n; ++i)
          {
            NodeParam param = (NodeParam) params.get(i);

            param = (NodeParam) param.clone();

            NamedObjectCollectionUtil.createUniqueName(param, targetSocket.getParamList());

            targetSocket.addParam(param, - 1);
            param.maintainReferences(ModelObject.RESOLVE_GLOBAL_REFS | ModelObject.RESOLVE_LOCAL_REFS);

            // Add the corresponding param figure and select it
            ParamFigure paramFigure = socketFigure.addParam(param, - 1);
            workspaceView.addToSelection(paramFigure);
View Full Code Here

        {
          errMsg("Warning: Final node '" + finalNode.getQualifier() + "' contains more than one return parameter.");
          break;
        }

        NodeParam param = (NodeParam) it.next();

        // Determine the return data type
        DataTypeItem dataType = param.getDataType();
        returnType = determineJavaType(w, dataType);

        firstParam = false;
      }
    }

    // Print method name and opening parenthesis
    w.print(modifier + " " + returnType + " " + makeVariableName(initialNode) + "(");

    boolean firstParam = true;
    for (Iterator it = initialNode.getSocket().getParams(); it.hasNext();)
    {
      NodeParam param = (NodeParam) it.next();

      // Determine data type
      DataTypeItem dataType = param.getDataType();
      String type = determineJavaType(w, dataType);

      if (firstParam)
        firstParam = false;
      else
View Full Code Here

    throws Exception
  {
    // Initial node: Entry parameter assignments
    for (Iterator itParam = exitSocket.getParams(); itParam.hasNext();)
    {
      NodeParam param = (NodeParam) itParam.next();

      for (Iterator itLink = param.getDataLinks(); itLink.hasNext();)
      {
        DataLink link = (DataLink) itLink.next();

        String sourceName = makeVariableName(param);
        String targetName;
View Full Code Here

    boolean first = true;

    // Final node: Exit parameter assignments
    for (Iterator itParam = entrySocket.getParams(); itParam.hasNext();)
    {
      NodeParam param = (NodeParam) itParam.next();

      String expr = obtainExpression(param.getExpression(), "Java", param);
      if (expr == null)
        expr = param.getName();

      if (! first)
      {
        errMsg("Warning: Final node '" + entrySocket.getNode().getQualifier() + "' may not have more than one return parameter.");
        break;
View Full Code Here

  {
    if (socket != null)
    {
      for (Iterator it = socket.getParams(); it.hasNext();)
      {
        NodeParam param = (NodeParam) it.next();
        String name = param.getName();

        // TODO Feature 6: Hmmm, this should be checked against something like end-of-word or so
        if (expression.indexOf(name) >= 0)
        {
          String value = getParamValue(socket, name);
View Full Code Here

   * @throws CodeGeneratorException If the value could not be resolved
   */
  protected String getParamValue(NodeSocket socket, String paramName)
    throws CodeGeneratorException
  {
    NodeParam param = socket.getParamByName(paramName);
    if (param == null)
    {
      errMsg("Error: Parameter '" + paramName + "' does not exist in socket '" + socket.getQualifier() + "'.");
      throw new CodeGeneratorException();
    }

    Iterator it = param.getDataLinks();
    if (! it.hasNext())
    {
      // No parameters, try the expression
      if (param.getExpression() != null)
        return param.getExpression();

      errMsg("Error: Parameter '" + param.getQualifier() + "' not connected to a data link and not associated with an expression.");
      throw new CodeGeneratorException();
    }

    DataLink link = (DataLink) it.next();

    if (it.hasNext())
    {
      errMsg("Warning: Only a single data link allowed to parameter '" + param.getQualifier() + "'.");
    }

    Param sourceParam = link.getSourceParam();
    if (sourceParam instanceof ProcessVariable)
      // Use the name of the process variable as parameter substitution value
View Full Code Here

      if (o instanceof NodeParam)
      {
        if (!propertyBrowser.saveObject())
          return EVENT_IGNORED;

        NodeParam nodeParam = (NodeParam) o;

        String name = nodeParam.getName();
        DataTypeItem type = nodeParam.getDataType();
        addParam(name, type);
      }

      return EVENT_HANDLED;
    }
View Full Code Here

   */
  private void tryConnectParams(int mode)
  {
    for (int i = sourceParams.size() - 1; i >= 0; --i)
    {
      NodeParam sourceParam = (NodeParam) sourceParams.get(i);

      if (!sourceParam.isVisible())
      {
        // Skip invisible parameters
        continue;
      }

      if (sourceParam.getAutoConnectorMode() == NodeParam.AUTOCONNECTOR_OFF)
      {
        // This parameter shall not be considered by the autoconnector.
        continue;
      }

      if (isConnected(sourceParam, targetSocket))
      {
        // This source parameter is already connected
        // to a parameter of the target socket, so skip it.
        continue;
      }

      NodeParam targetParam = findTargetParam(sourceParam, mode);
      if (targetParam != null)
      {
        if (isConnected(sourceSocket, targetParam))
        {
          // This source parameter is already connected
View Full Code Here

   */
  private NodeParam findTargetParam(NodeParam sourceParam, int mode)
  {
    for (int i = targetParams.size() - 1; i >= 0; --i)
    {
      NodeParam targetParam = (NodeParam) targetParams.get(i);

      if (!targetParam.isVisible())
      {
        // Skip invisible parameters
        continue;
      }

      if (targetParam.getAutoConnectorMode() == NodeParam.AUTOCONNECTOR_OFF)
      {
        // This parameter shall not be considered by the autoconnector.
        continue;
      }

      if (targetParam.getExpression() != null)
      {
        // Skip target parameters that already have an expression assigned.
        continue;
      }

      DataTypeItem sourceType = sourceParam.getDataType();
      DataTypeItem targetType = targetParam.getDataType();

      switch (mode)
      {
      case DLA_IDENTICAL_NAMES:
        // Data link autoconnector operation mode: Connect identical names
        if (sourceParam.getName().equals(targetParam.getName()))
        {
          if (sourceType == targetType || targetType.isBaseTypeOf(sourceType))
          {
            return targetParam;
          }
View Full Code Here

TOP

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

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.