Search in sources :

Example 41 with WorkflowRuntimeException

use of org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException in project airavata by apache.

the class WorkflowHarvester method cleanLeftOverInputNodes.

/**
 * @param clone
 */
private void cleanLeftOverInputNodes(Workflow clone) {
    List<NodeImpl> nodes = clone.getGraph().getNodes();
    LinkedList<Node> removeList = new LinkedList<Node>();
    for (Node nodeImpl : nodes) {
        if (nodeImpl instanceof InputNode) {
            if (nodeImpl.getOutputPort(0).getToNodes().size() == 0) {
                removeList.add(nodeImpl);
            }
        }
    }
    for (Node node : removeList) {
        try {
            clone.removeNode(node);
        } catch (GraphException e) {
            throw new WorkflowRuntimeException(e);
        }
    }
}
Also used : GraphException(org.apache.airavata.workflow.model.graph.GraphException) InputNode(org.apache.airavata.workflow.model.graph.system.InputNode) NodeImpl(org.apache.airavata.workflow.model.graph.impl.NodeImpl) InputNode(org.apache.airavata.workflow.model.graph.system.InputNode) WSNode(org.apache.airavata.workflow.model.graph.ws.WSNode) Node(org.apache.airavata.workflow.model.graph.Node) WorkflowRuntimeException(org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException) LinkedList(java.util.LinkedList)

Aggregations

WorkflowRuntimeException (org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException)41 DataPort (org.apache.airavata.workflow.model.graph.DataPort)25 GraphException (org.apache.airavata.workflow.model.graph.GraphException)13 DataEdge (org.apache.airavata.workflow.model.graph.DataEdge)12 Node (org.apache.airavata.workflow.model.graph.Node)11 DataType (org.apache.airavata.model.application.io.DataType)10 InputNode (org.apache.airavata.workflow.model.graph.system.InputNode)9 ComponentDataPort (org.apache.airavata.workflow.model.component.ComponentDataPort)8 Port (org.apache.airavata.workflow.model.graph.Port)8 Kind (org.apache.airavata.workflow.model.graph.Port.Kind)7 WSNode (org.apache.airavata.workflow.model.graph.ws.WSNode)7 WSPort (org.apache.airavata.workflow.model.graph.ws.WSPort)6 LinkedList (java.util.LinkedList)4 DataType (org.apache.airavata.model.appcatalog.appinterface.DataType)4 EPRPort (org.apache.airavata.workflow.model.graph.EPRPort)4 NodeImpl (org.apache.airavata.workflow.model.graph.impl.NodeImpl)4 Point (java.awt.Point)3 File (java.io.File)3 ArrayList (java.util.ArrayList)3 EndForEachNode (org.apache.airavata.workflow.model.graph.system.EndForEachNode)3