Package org.apache.airavata.workflow.model.graph

Examples of org.apache.airavata.workflow.model.graph.DataPort


        super.edgeWasAdded(edge);

        // TODO organize this.
        if (edge instanceof DataEdge) {
            DataEdge dataEdge = (DataEdge) edge;
            DataPort toPort = dataEdge.getToPort();
            QName toType = toPort.getType();

            List<DataEdge> edges = getEdges();
            if (edges.size() == 1) {
                // The first edge.
                setParameterType(toType);
View Full Code Here


        return exitNode;
    }

    protected void createPorts(NodeImpl node) {
        for (ComponentDataPort input : getInputPorts()) {
            DataPort port = input.createPort();
            node.addInputPort(port);
        }

        for (ComponentDataPort output : getOutputPorts()) {
            DataPort port = output.createPort();
            node.addOutputPort(port);
        }

        if (this.controlInPort != null) {
            ControlPort port = this.controlInPort.createPort();
View Full Code Here

      if (!(fromPort instanceof DataPort || fromPort instanceof EPRPort)
          || !(toPort instanceof DataPort)) {
        throw new GraphException(MessageConstants.UNEXPECTED_ERROR);
      }

      DataPort fromDataPort = (DataPort) fromPort;
      DataPort toDataPort = (DataPort) toPort;

      QName fromType = fromDataPort.getType();
      QName toType = toDataPort.getType();

      if (toDataPort.getEdges().size() > 1) {
        throw new GraphException(
            MessageConstants.MORE_THAN_ONE_CONNECTIONS);
      }

      // if connection came from the CEP register component it should be
View Full Code Here

  public static void propagateTypes(Graph graph) throws GraphException {
    List<WSPort> wsPorts = getPorts(graph, WSPort.class);
    for (WSPort wsPort : wsPorts) {
      List<DataEdge> edges = wsPort.getEdges();
      for (DataEdge edge : edges) {
        DataPort fromPort = edge.getFromPort();

        DataPort toPort = edge.getToPort();
        if (fromPort == wsPort) {
          toPort.copyType(wsPort);
        } else if (toPort == wsPort) {
          fromPort.copyType(wsPort);
        } else {
          throw new WorkflowRuntimeException();
        }
View Full Code Here

    /**
   *
   */
    public boolean isAllInPortsConnected() {
        for (Iterator<DataPort> iterator = this.inputPorts.iterator(); iterator.hasNext();) {
            DataPort port = iterator.next();
            if (port.getFromNode() == null) {
                return false;
            }

        }
        return true;
View Full Code Here

        List<DataEdge> edges = getEdges();
        QName parameterType = super.getParameterType();
        if (parameterType == null && getEdges().size() > 0) {
            // This happens when the graph XML doesn't have parameterType.
            DataEdge edge = edges.get(0);
            DataPort toPort = edge.getToPort();
            parameterType = toPort.getType();
        }
        return parameterType;
    }
View Full Code Here

        super.edgeWasAdded(edge);

        // TODO organize this.
        if (edge instanceof DataEdge) {
            DataEdge dataEdge = (DataEdge) edge;
            DataPort toPort = dataEdge.getToPort();
            QName toType = toPort.getType();

            List<DataEdge> edges = getEdges();
            if (edges.size() == 1) {
                // The first edge.
                setParameterType(toType);
View Full Code Here

            Port fromPort = inPort.getFromPort();
            Node fromNode = inPort.getFromNode();
            if (fromNode instanceof WSNode) {
                WSNode fromWsNode = (WSNode) fromNode;
                if (null != fromPort && fromPort instanceof DataPort) {
                    DataPort fromDataPort = (DataPort) fromPort;
                    WsdlDefinitions wsdl = engine.getGUI().getWorkflow().getWSDLs().get(fromWsNode.getWSDLID());
                    Iterator<XmlNamespace> itr = wsdl.xml().namespaces().iterator();
                    try {
                        XmlElement schema = wsdl.getTypes().element("schema").clone();
                        // do not change the following ordering of setting
View Full Code Here

            if (graphPiece instanceof DynamicNode) {
                if (this.draggedPort.getKind() == Kind.DATA_OUT && draggedPort instanceof DataPort) {
                    this.panel.setCursor(SwingUtil.CROSSHAIR_CURSOR);
                    DynamicNode dynamicNode = (DynamicNode) graphPiece;
                    dynamicNode.getComponent();
                    DataPort freePort = dynamicNode.getFreeInPort();
                    try {
                        freePort.copyType((DataPort) draggedPort);
                    } catch (GraphException e) {
                        engine.getGUI().getErrorWindow().error(e);
                        return;
                    }
                    // selectInputPort(freePort);
View Full Code Here

        // Create a copy to global variable.
        List<DataPort> outputPorts = endifNode.getOutputPorts();
        ArrayList<GpelAssignCopy> copies = new ArrayList<GpelAssignCopy>();
        for (int i = 0; i < outputPorts.size(); i++) {
            DataPort outputPort = outputPorts.get(i);
            String variable = outputPort.getID() + OUTPUT_SUFFIX;
            int index = ifBlock ? i : i + outputPorts.size();
            DataPort inputPort = endifNode.getInputPort(index);
            Port fromPort = inputPort.getFromPort();
            GpelAssignCopyFrom from = createAssignCopyFrom(fromPort);
            GpelAssignCopyTo to = new GpelAssignCopyTo(this.bpelNS);
            to.setVariable(variable);
            GpelAssignCopy copy = new GpelAssignCopy(this.bpelNS, from, to);
            copies.add(copy);
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.graph.DataPort

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.