use of org.apache.airavata.workflow.model.component.Component in project airavata by apache.
the class SystemComponentRegistry method getComponentReferenceList.
/**
* Returns a ComponentTree.
*
* @return The ComponentTree
*/
@Override
public List<ComponentReference> getComponentReferenceList() {
List<ComponentReference> tree = new ArrayList<ComponentReference>();
for (String name : this.componentMap.keySet()) {
Component component = this.componentMap.get(name);
SystemComponentReference componentReference = new SystemComponentReference(name, component);
tree.add(componentReference);
}
return tree;
}
use of org.apache.airavata.workflow.model.component.Component 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