use of org.apache.airavata.workflow.model.graph.impl.EdgeImpl in project airavata by apache.
the class DoWhileHandler method handleDowhile.
/**
* To get only web service components attached to dowhile
*
* @param waitingNode
* @return list
*/
private ArrayList<Node> handleDowhile(ArrayList<Node> waitingNode, ArrayList<Node> finishedNodes) {
ArrayList<Node> list = new ArrayList<Node>();
for (Node node : waitingNode) {
Component component = node.getComponent();
if (component instanceof WSComponent) {
ControlPort control = node.getControlInPort();
boolean controlDone = true;
if (control != null) {
for (EdgeImpl edge : control.getEdges()) {
controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode()) || ((ControlPort) edge.getFromPort()).isConditionMet());
}
}
/*
* Check for input ports
*/
List<DataPort> inputPorts = node.getInputPorts();
boolean inputsDone = true;
for (DataPort dataPort : inputPorts) {
inputsDone = inputsDone && finishedNodes.contains(dataPort.getFromNode());
}
if (inputsDone && controlDone) {
list.add(node);
}
}
}
return list;
}
Aggregations