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

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


   * Adds additional input port.
   */
  public void addInputPort() {
    DoWhileComponent component = getComponent();
    ComponentDataPort input = component.getInputPort();
    DataPort port = input.createPort();
    addInputPort(port);
  }
View Full Code Here


  }

  public DataPort addInputPortAndReturn() {
    DoWhileComponent component = getComponent();
    ComponentDataPort input = component.getInputPort();
    DataPort port = input.createPort();
    addInputPort(port);
    return port;
  }
View Full Code Here

  }

  public void removeInputPort() throws GraphException {
    List<DataPort> inputPorts = getInputPorts();
    // Remove the last one.
    DataPort inputPort = inputPorts.get(inputPorts.size() - 1);
    removeInputPort(inputPort);
  }
View Full Code Here

   * Adds additional output port.
   */
  public void addOutputPort() {
    DoWhileComponent component = getComponent();
    ComponentDataPort outputPort = component.getOutputPort();
    DataPort port = outputPort.createPort();
    addOutputPort(port);
  }
View Full Code Here

   * @throws GraphException
   */
  public void removeOutputPort() throws GraphException {
    List<DataPort> outputPorts = getOutputPorts();
    // Remove the last one.
    DataPort outputPort = outputPorts.get(outputPorts.size() - 1);
    removeOutputPort(outputPort);
  }
View Full Code Here

            if (fromPort instanceof EPRPort) {
                // TODO
                return;
            }

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

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

            if (fromDataPort.getNode() == this) {
                // setType() propagates the change to the whole workflow.
                if (!(toType == null || toType.equals(WSConstants.XSD_ANY_TYPE))) {
                    fromDataPort.copyType(toDataPort);
                }
            } else if (toDataPort.getNode() == this) {
                if (!(fromType == null || fromType.equals(WSConstants.XSD_ANY_TYPE))) {
                    toDataPort.copyType(fromDataPort);
                }
            } else {
                throw new WorkflowRuntimeException();
            }
        }
View Full Code Here

        super.edgeWasAdded(edge);
        // TODO this method can be removed.
        Port toPort = edge.getToPort();

        if (edge instanceof DataEdge) {
            DataPort toDataPort = (DataPort) toPort;
            QName toType = toDataPort.getType();

            List edges = getEdges();
            if (edges.size() == 1) {
                // The first edge.
                this.type = toType;
View Full Code Here

        }
        return configElement;
    }

    private List<DataEdge> getEdges() {
        DataPort port = getPort();
        List<DataEdge> edges = port.getEdges();
        return edges;
    }
View Full Code Here

            // propagate to the connected ports.
            Kind kind = getKind();
            for (DataEdge edge : getEdges()) {
                if (kind == Kind.DATA_IN) {
                    DataPort fromPort = edge.getFromPort();
                    fromPort.copyType(this);
                } else if (kind == Kind.DATA_OUT) {
                    DataPort toPort = edge.getToPort();
                    toPort.copyType(this);
                } else {
                    throw new WorkflowRuntimeException();
                }
            }
        }
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

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.