Search in sources :

Example 31 with DataPort

use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.

the class EndForEachNode method removeInputPort.

/**
 * Removes the last input port.
 *
 * @throws GraphException
 */
public void removeInputPort() throws GraphException {
    List<DataPort> inputPorts = getInputPorts();
    // Remove the last one.
    DataPort inputPort = inputPorts.get(inputPorts.size() - 1);
    removeInputPort(inputPort);
}
Also used : DataPort(org.apache.airavata.workflow.model.graph.DataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort)

Example 32 with DataPort

use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.

the class EndifNode method removeOutputPort.

/**
 * Removes the last output port.
 *
 * @throws GraphException
 */
public void removeOutputPort() throws GraphException {
    List<DataPort> outputPorts = getOutputPorts();
    // Remove the last one.
    DataPort outputPort = outputPorts.get(outputPorts.size() - 1);
    removeOutputPort(outputPort);
}
Also used : DataPort(org.apache.airavata.workflow.model.graph.DataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort)

Example 33 with DataPort

use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.

the class EndifNode method addOutputPort.

/**
 * Adds additional output port.
 */
public void addOutputPort() {
    EndifComponent component = getComponent();
    ComponentDataPort outputPort = component.getOutputPort();
    DataPort port = outputPort.createPort();
    addOutputPort(port);
}
Also used : DataPort(org.apache.airavata.workflow.model.graph.DataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort) EndifComponent(org.apache.airavata.workflow.model.component.system.EndifComponent)

Example 34 with DataPort

use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.

the class ForEachNode method getFreeInPort.

public DataPort getFreeInPort() {
    List<DataPort> inputPorts = this.getInputPorts();
    for (DataPort dataPort : inputPorts) {
        if (null == dataPort.getFromNode()) {
            return dataPort;
        }
    }
    addOutputPort();
    return addInputPortAndReturn();
}
Also used : DataPort(org.apache.airavata.workflow.model.graph.DataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort)

Example 35 with DataPort

use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.

the class ForEachNode method removeLastDynamicallyAddedInPort.

public void removeLastDynamicallyAddedInPort() throws GraphException {
    List<DataPort> inputPorts = this.getInputPorts();
    List<DataPort> outputPorts = this.getOutputPorts();
    if (inputPorts.size() == 1) {
        // This is the initial port, so leave it alone
        return;
    }
    if (outputPorts.size() == 1) {
        return;
    }
    DataPort portToBeRemoved = null;
    for (DataPort dataPort : inputPorts) {
        if (null == dataPort.getFromNode()) {
            removeInputPort(dataPort);
            portToBeRemoved = dataPort;
            break;
        }
    }
    if (outputPorts.size() == this.getInputPorts().size()) {
        return;
    }
    for (DataPort dataPort : outputPorts) {
        if (0 == dataPort.getToNodes().size()) {
            removeOutputPort(dataPort);
            portToBeRemoved = dataPort;
            break;
        }
    }
}
Also used : DataPort(org.apache.airavata.workflow.model.graph.DataPort) ComponentDataPort(org.apache.airavata.workflow.model.component.ComponentDataPort)

Aggregations

DataPort (org.apache.airavata.workflow.model.graph.DataPort)100 ComponentDataPort (org.apache.airavata.workflow.model.component.ComponentDataPort)39 WorkflowRuntimeException (org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException)26 Node (org.apache.airavata.workflow.model.graph.Node)26 DataEdge (org.apache.airavata.workflow.model.graph.DataEdge)20 WSNode (org.apache.airavata.workflow.model.graph.ws.WSNode)16 GraphException (org.apache.airavata.workflow.model.graph.GraphException)15 InputNode (org.apache.airavata.workflow.model.graph.system.InputNode)13 DataType (org.apache.airavata.model.application.io.DataType)12 DynamicNode (org.apache.airavata.workflow.model.graph.dynamic.DynamicNode)12 Port (org.apache.airavata.workflow.model.graph.Port)11 WSPort (org.apache.airavata.workflow.model.graph.ws.WSPort)10 SubWorkflowNode (org.apache.airavata.workflow.model.graph.subworkflow.SubWorkflowNode)9 DataType (org.apache.airavata.model.appcatalog.appinterface.DataType)8 NodeImpl (org.apache.airavata.workflow.model.graph.impl.NodeImpl)8 LinkedList (java.util.LinkedList)7 ControlPort (org.apache.airavata.workflow.model.graph.ControlPort)7 EPRPort (org.apache.airavata.workflow.model.graph.EPRPort)7 EndForEachNode (org.apache.airavata.workflow.model.graph.system.EndForEachNode)6 ForEachNode (org.apache.airavata.workflow.model.graph.system.ForEachNode)6