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

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


          // Apply auto-conversions for data links if necessary
          if (connectionFigure instanceof ParamConnection)
          {
            ParamConnection paramConnection = (ParamConnection) connectionFigure;
            DataLink dataLink = paramConnection.getDataLink();

            String newSourceMemberPath = DataLinkImpl.checkAutoConversion(dataLink.getSourceParam(), dataLink.getSourceMemberPath(), dataLink.getTargetParam(), dataLink.getTargetMemberPath());
            dataLink.setSourceMemberPath(newSourceMemberPath);
          }

          connectionFigure.layoutAndAdjustConnection();

          connectionFigure.setDrawDecorations(true);
View Full Code Here


        else if (next instanceof ParamConnection)
        {
          ParamConnection paramConnection = (ParamConnection) next;

          DataLink link = paramConnection.getDataLink();

          Param sourceParam = link.getSourceParam();
          Param targetParam = link.getTargetParam();

          if (sourceParam instanceof NodeParam)
          {
            if (! copiedSourceNodes.contains(((NodeParam) sourceParam).getSocket().getNode()))
            {
              // Link source or target has not been copied
              continue;
            }
          }
          else
          {
            // Don't copy process variable links
            continue;
          }

          if (targetParam instanceof NodeParam)
          {
            if (! copiedSourceNodes.contains(((NodeParam) targetParam).getSocket().getNode()))
            {
              // Link source or target has not been copied
              continue;
            }
          }
          else
          {
            // Don't copy process variable links
            continue;
          }

          paramConnection.encodeGeometry();

          link = (DataLink) link.clone();
          process.addDataLink(link);

          if (! msgContainer.isEmpty())
          {
            // One of the end points of the link is not present in the copied set,
View Full Code Here

    }

    // Add the data links
    for (Iterator it = source.getDataLinks(); it.hasNext();)
    {
      DataLink link = (DataLink) it.next();

      target.addDataLink(link);

      // Determine the reference names after adding the object to the target
      link.maintainReferences(ModelObject.SYNC_LOCAL_REFNAMES);

      ParamConnection paramConnection = drawing.createParamConnection(link);
      if (paramConnection == null)
      {
        target.removeDataLink(link);
View Full Code Here

    {
      NodeParam param = (NodeParam) itParam.next();

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

        String sourceName = makeVariableName(param);
        String targetName;

        Param targetParam = link.getTargetParam();
        if (targetParam instanceof ProcessVariable)
        {
          // Use the name of the process variable as parameter substitution value
          targetName = makeVariableName(targetParam);
        }
View Full Code Here

      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
      return makeVariableName(sourceParam);

    // Use the name of the data link as parameter substitution value (is used as temporary variable)
View Full Code Here

            dataLinks = (List) CopyUtil.copyCollection(currentProcess.getDataLinkList(), CopyUtil.CLONE_NONE);

            // Delete each data link from/to it by releasing the associated figure
            for (Iterator itLinks = dataLinks.iterator(); itLinks.hasNext();)
            {
              DataLink link = (DataLink) itLinks.next();

              if (link.getSourceParam() == oldVar || link.getTargetParam() == oldVar)
              {
                // DEBUG System.out.println ("Removing data link " + link.getName () + " from " + link.getSourceParam ().getPath () + " to " + link.getTargetParam ().getPath ());
                ProcessVariableConnection con = (ProcessVariableConnection) link.getRepresentation();
                con.release();

                // Remove the link itself
                currentProcess.removeDataLink(link);
              }
View Full Code Here

      modeler.startUndo("Auto-connect parameters");
    }

    // Create a new data link and add it to the process
    ProcessItem process = sourceParam.getProcess();
    DataLink dataLink = process.createDataLink();

    // Link the parameters
    dataLink.link(sourceParam, targetParam);

    // Apply auto-conversions if necessary
    String sourceMemberPath = DataLinkImpl.checkAutoConversion(sourceParam, null, targetParam, null);
    dataLink.setSourceMemberPath(sourceMemberPath);

    // Add the link to the process
    process.addDataLink(dataLink);

    // Now create a connection figure and add it to the drawing
View Full Code Here

   */
  private static boolean isConnected(NodeParam sourceParam, NodeSocket targetSocket)
  {
    for (Iterator it = sourceParam.getDataLinks(); it.hasNext();)
    {
      DataLink dataLink = (DataLink) it.next();

      if (dataLink.getTargetParam() instanceof NodeParam && ((NodeParam) dataLink.getTargetParam()).getSocket() == targetSocket)
        return true;
    }
    return false;
  }
View Full Code Here

   */
  private static boolean isConnected(NodeSocket sourceSocket, NodeParam targetParam)
  {
    for (Iterator it = sourceSocket.getNode().getProcess().getDataLinks(); it.hasNext();)
    {
      DataLink dataLink = (DataLink) it.next();

      if (dataLink.getSourceParam() instanceof NodeParam && ((NodeParam) dataLink.getSourceParam()).getSocket() == sourceSocket &&
          dataLink.getTargetParam() == targetParam)
        return true;
    }
    return false;
  }
View Full Code Here

    ProcessItem process = param.getProcess();
    if (process != null)
    {
      for (Iterator it = process.getDataLinks(); it.hasNext();)
      {
        DataLink link = (DataLink) it.next();
        if (param == link.getSourceParam() || param == link.getTargetParam())
        {
          // Source or target of a data link
          return false;
        }
      }
View Full Code Here

TOP

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

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.