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

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


    public QName getParameterType() {
        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


    protected void edgeWasAdded(Edge edge) throws GraphException {
        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.
View Full Code Here

    public QName getParameterType() {
        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

    protected void edgeWasAdded(Edge edge) throws GraphException {
        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.
View Full Code Here

    public QName getParameterType() {
        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

    protected void edgeWasAdded(Edge edge) throws GraphException {
        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.
View Full Code Here

        // Remove edges connected to input ports.
        for (Iterator<DataPort> portItr = nodeImpl.getInputPorts().iterator(); portItr.hasNext();) {
            DataPort port = portItr.next();
            for (Iterator<DataEdge> edgeItr = port.getEdges().iterator(); edgeItr.hasNext();) {
                DataEdge edge = edgeItr.next();
                // Remove the edge from from-port.
                DataPort fromPort = edge.getFromPort();
                fromPort.removeEdge(edge);
                // remove the edge from this port. This is necessary so that
                // type update works properly.
                edgeItr.remove();

                // Remove the edge from the graph.
                this.edges.remove(edge);
                fromPort.getNode().edgeWasRemoved(edge);
            }
            // Remove the port from the node.
            portItr.remove();
            // Remove the port from the graph.
            this.ports.remove(port);
        }

        // Remove edges connected to output ports.
        for (Iterator<DataPort> portItr = nodeImpl.getOutputPorts().iterator(); portItr.hasNext();) {
            DataPort port = portItr.next();
            for (Iterator<DataEdge> edgeItr = port.getEdges().iterator(); edgeItr.hasNext();) {
                DataEdge edge = edgeItr.next();
                DataPort toPort = edge.getToPort();
                toPort.removeEdge(edge);
                edgeItr.remove();
                this.edges.remove(edge);
                toPort.getNode().edgeWasRemoved(edge);
            }
            portItr.remove();
            this.ports.remove(port);
        }

        for (Iterator<ControlPort> portItr = nodeImpl.getControlOutPorts().iterator(); portItr.hasNext();) {
            PortImpl port = portItr.next();
            for (Iterator<? extends EdgeImpl> edgeItr = port.getEdges().iterator(); edgeItr.hasNext();) {
                EdgeImpl edge = edgeItr.next();
                PortImpl toPort = edge.getToPort();
                toPort.removeEdge(edge);
                edgeItr.remove();
                this.edges.remove(edge);
                toPort.getNode().edgeWasRemoved(edge);
            }
            portItr.remove();
            this.ports.remove(port);
        }

        PortImpl controlInPort = nodeImpl.getControlInPort();
        if (controlInPort != null) {
            for (Iterator<? extends EdgeImpl> edgeItr = controlInPort.getEdges().iterator(); edgeItr.hasNext();) {
                EdgeImpl edge = edgeItr.next();
                PortImpl fromPort = edge.getFromPort();
                fromPort.removeEdge(edge);
                edgeItr.remove();
                this.edges.remove(edge);
                fromPort.getNode().edgeWasRemoved(edge);
            }
            this.ports.remove(controlInPort);
        }

        PortImpl eprPort = nodeImpl.getEPRPort();
        if (eprPort != null) {
            for (Iterator<? extends EdgeImpl> edgeItr = eprPort.getEdges().iterator(); edgeItr.hasNext();) {
                EdgeImpl edge = edgeItr.next();
                PortImpl toPort = edge.getToPort();
                toPort.removeEdge(edge);
                edgeItr.remove();
                this.edges.remove(edge);
                toPort.getNode().edgeWasRemoved(edge);
            }
View Full Code Here

        || (fromKind == Kind.CONTROL_OUT && toKind == Kind.CONTROL_IN) || (fromKind == Kind.EPR && toKind == Kind.DATA_IN))) {
      throw new WorkflowRuntimeException();
    }
    EdgeImpl edge;
    if (toKind == Kind.DATA_IN) {
      edge = new DataEdge();
    } else if (toKind == Kind.CONTROL_IN) {
      edge = new ControlEdge();
    } else {
      // Should not happen.
      throw new WorkflowRuntimeException();
View Full Code Here

  public EdgeImpl createEdge(XmlElement edgeElement) {
    String type = edgeElement.attributeValue(GraphSchema.NS,
        GraphSchema.EDGE_TYPE_ATTRIBUTE);
    EdgeImpl edge;
    if (GraphSchema.EDGE_TYPE_DATA.equals(type)) {
      edge = new DataEdge(edgeElement);
    } else if (GraphSchema.PORT_TYPE_CONTROL.equals(type)) {
      edge = new ControlEdge(edgeElement);
    } else {
      // Default is WsPort because of backword compatibility
      edge = new DataEdge(edgeElement);
    }
    return edge;
  }
View Full Code Here

    public QName getParameterType() {
        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

TOP

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

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.