Search in sources :

Example 16 with Component

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;
}
Also used : ComponentReference(org.apache.airavata.workflow.model.component.ComponentReference) ArrayList(java.util.ArrayList) DynamicComponent(org.apache.airavata.workflow.model.component.dynamic.DynamicComponent) Component(org.apache.airavata.workflow.model.component.Component)

Example 17 with Component

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;
}
Also used : DataPort(org.apache.airavata.workflow.model.graph.DataPort) ControlPort(org.apache.airavata.workflow.model.graph.ControlPort) EndDoWhileNode(org.apache.airavata.workflow.model.graph.system.EndDoWhileNode) Node(org.apache.airavata.workflow.model.graph.Node) DoWhileNode(org.apache.airavata.workflow.model.graph.system.DoWhileNode) ArrayList(java.util.ArrayList) WSComponent(org.apache.airavata.workflow.model.component.ws.WSComponent) EdgeImpl(org.apache.airavata.workflow.model.graph.impl.EdgeImpl) WSComponent(org.apache.airavata.workflow.model.component.ws.WSComponent) Component(org.apache.airavata.workflow.model.component.Component)

Aggregations

Component (org.apache.airavata.workflow.model.component.Component)17 ComponentReference (org.apache.airavata.workflow.model.component.ComponentReference)5 WSComponent (org.apache.airavata.workflow.model.component.ws.WSComponent)5 ArrayList (java.util.ArrayList)4 InstanceComponent (org.apache.airavata.workflow.model.component.amazon.InstanceComponent)3 TerminateInstanceComponent (org.apache.airavata.workflow.model.component.amazon.TerminateInstanceComponent)3 DynamicComponent (org.apache.airavata.workflow.model.component.dynamic.DynamicComponent)3 InputComponent (org.apache.airavata.workflow.model.component.system.InputComponent)3 Node (org.apache.airavata.workflow.model.graph.Node)3 XBayaComponent (org.apache.airavata.xbaya.ui.widgets.XBayaComponent)3 Point (java.awt.Point)2 ComponentException (org.apache.airavata.workflow.model.component.ComponentException)2 ComponentRegistryException (org.apache.airavata.workflow.model.component.ComponentRegistryException)2 ControlPort (org.apache.airavata.workflow.model.graph.ControlPort)2 DataPort (org.apache.airavata.workflow.model.graph.DataPort)2 EdgeImpl (org.apache.airavata.workflow.model.graph.impl.EdgeImpl)2 Transferable (java.awt.datatransfer.Transferable)1 UnsupportedFlavorException (java.awt.datatransfer.UnsupportedFlavorException)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1