use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.
the class ForEachNode method addInputPortAndReturn.
public DataPort addInputPortAndReturn() {
ForEachComponent component = getComponent();
ComponentDataPort input = component.getInputPort();
DataPort port = input.createPort();
addInputPort(port);
return port;
}
use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.
the class ConstantNode method getEdges.
private List<DataEdge> getEdges() {
DataPort port = getPort();
List<DataEdge> edges = port.getEdges();
return edges;
}
use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.
the class DoWhileNode method addOutputPort.
/**
* Adds additional output port.
*/
public void addOutputPort() {
DoWhileComponent component = getComponent();
ComponentDataPort outputPort = component.getOutputPort();
DataPort port = outputPort.createPort();
addOutputPort(port);
}
use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.
the class SystemDataPort method copyType.
/**
* @param port
* @param arrayIncrement
* @throws GraphException
*/
public void copyType(DataPort port, int arrayIncrement) throws GraphException {
DataType newType = port.getType();
if (this.type != newType) {
this.type = newType;
if (port instanceof WSPort) {
WSPort wsPort = (WSPort) port;
this.wsComponentPort = wsPort.getComponentPort();
this.arrayDimension = 0;
} else if (port instanceof SystemDataPort) {
SystemDataPort systemPort = (SystemDataPort) port;
this.wsComponentPort = systemPort.getWSComponentPort();
this.arrayDimension = systemPort.getArrayDimension() + arrayIncrement;
}
// propagate to other ports of this node.
getNode().portTypeChanged(this);
// 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();
}
}
}
}
use of org.apache.airavata.workflow.model.graph.DataPort in project airavata by apache.
the class GraphUtil method isSameLabeledInput.
/**
* @param node
* @return null if not the same
*/
public static String isSameLabeledInput(Node node) {
if (!isAllInputsConnected(node)) {
throw new WorkflowRuntimeException("Node inputs not connected" + node);
}
if (!isAllInputsLabeled(node)) {
throw new WorkflowRuntimeException("Some or all of the node inputs not labeled" + node);
}
List<DataPort> inputPorts = node.getInputPorts();
String label = inputPorts.get(0).getEdge(0).getLabel();
for (DataPort dataPort : inputPorts) {
// 0 because its got only one
if (!label.equals(dataPort.getEdge(0).getLabel())) {
return null;
}
}
return label;
}
Aggregations