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

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


        if (next instanceof FlowConnection)
        {
          FlowConnection flowConnection = (FlowConnection) next;

          ControlLink link = flowConnection.getControlLink();

          if (! copiedSourceNodes.contains(link.getSourceSocket().getNode())
            || ! copiedSourceNodes.contains(link.getTargetSocket().getNode()))
          {
            // Link source or target has not been copied
            continue;
          }

          flowConnection.encodeGeometry();

          link = (ControlLink) link.clone();
          process.addControlLink(link);

          if (! msgContainer.isEmpty())
          {
            // One of the end points of the link is not present in the copied set,
            // so remove the link from the dummy process again.
            process.removeControlLink(link);
            msgContainer.clearMsgs();
          }
        }

        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 control links
    for (Iterator it = source.getControlLinks(); it.hasNext();)
    {
      ControlLink link = (ControlLink) it.next();

      target.addControlLink(link);

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

      FlowConnection flowConnection = drawing.createFlowConnection(link);
      if (flowConnection == null)
      {
        target.removeControlLink(link);
        continue;
      }

      workspaceView.add(flowConnection);
      workspaceView.addToSelection(flowConnection);
    }

    // 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

      {
        errMsg("Error: Node '" + node.getQualifier() + "' has no default exit socket or no control links attached to the socket.");
        throw new CodeGeneratorException();
      }

      ControlLink cl = (ControlLink) exitSocket.getControlLinks().next();
      socket = cl.getTargetSocket();
    }
  }
View Full Code Here

      {
        errMsg("Error: Node '" + node.getQualifier() + "' has no default exit socket or no control links attached to the socket.");
        throw new CodeGeneratorException();
      }

      ControlLink cl = (ControlLink) socket.getControlLinks().next();
      socket = cl.getTargetSocket();
    }

    return null;
  }
View Full Code Here

      {
        errMsg("Error: Node '" + node.getQualifier() + "' has no default exit socket or no control links attached to the socket.");
        throw new CodeGeneratorException();
      }

      ControlLink cl = (ControlLink) socket.getControlLinks().next();
      socket = cl.getTargetSocket();
    }

    return false;
  }
View Full Code Here

          }
        }
        else if (o instanceof FlowConnection)
        {
          // Control link selected; add the Qualifiers of its start end end sockets
          ControlLink controlLink = ((FlowConnection) o).getControlLink();
          qualifiers.add(controlLink.getSourceSocket().getQualifier());
          qualifiers.add(controlLink.getTargetSocket().getQualifier());
        }
      }

      int nQualifiers = qualifiers.size();
      if (nQualifiers == 0)
View Full Code Here

    if (!(other instanceof FlowConnection))
    {
      return false;
    }

    ControlLink otherLink = ((FlowConnection) other).getControlLink();

    return controlLink.getSourceSocketName().equals(otherLink.getSourceSocketName()) && controlLink.getTargetSocketName().equals(otherLink.getTargetSocketName());
  }
View Full Code Here

    boolean haveControlLink = false;
    NodeSocket startSocket = startSocketFigure.getNodeSocket();
    NodeSocket endSocket = endSocketFigure.getNodeSocket();
    for (Iterator it = startSocket.getControlLinks(); it.hasNext();)
    {
      ControlLink link = (ControlLink) it.next();
      if (link.getTargetSocket() == endSocket)
      {
        haveControlLink = true;
        break;
      }
    }
    for (Iterator it = endSocket.getControlLinks(); it.hasNext();)
    {
      ControlLink link = (ControlLink) it.next();
      if (link.getTargetSocket() == startSocket)
      {
        haveControlLink = true;
        break;
      }
    }
View Full Code Here

    // Now forward control to the sockets connected to this exit socket, if any
    NodeSocket oldCurrentSocket = context.getCurrentSocket();
    for (Iterator it = exitSocket.getControlLinks(); it.hasNext();)
    {
      ControlLink link = (ControlLink) it.next();

      if (engine.hasActiveObservers(EngineTraceEvent.CONTROL_FLOW, context))
      {
        engine.fireEngineEvent(new EngineTraceEvent(EngineTraceEvent.CONTROL_FLOW, context, link, engine));
      }
View Full Code Here

      if (! socket.hasControlLinks())
        break;

      // Follow the first control link to the next node
      ControlLink link = (ControlLink) socket.getControlLinks().next();
      socket = link.getTargetSocket();
      node = socket.getNode();
    }

    return null;
  }
View Full Code Here

TOP

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

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.