Package org.apache.airavata.workflow.model.graph

Examples of org.apache.airavata.workflow.model.graph.ControlPort


          || component instanceof InstanceComponent) {

        /*
         * Check for control ports from other node
         */
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode())
            // amazon component use condition met to check
            // whether the control port is done
            // FIXME I changed the "||" to a "&&" in the following since thats the only this
            // that makes sense and if anyone found a scenario it should be otherwise pls fix
                || ((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);
        }
      } else if (component instanceof EndifComponent) {
        /*
         * EndIfComponent can run if number of input equals to number of
         * output that it expects
         */
        int expectedOutput = node.getOutputPorts().size();
        int actualInput = 0;
        List<DataPort> inputPorts = node.getInputPorts();
        for (DataPort dataPort : inputPorts) {
          if (finishedNodes.contains(dataPort.getFromNode()))
            actualInput++;
        }

        if (expectedOutput == actualInput) {
          list.add(node);
        }
      } else if (component instanceof TerminateInstanceComponent) {
        /*
         * All node connected to controlIn port must be done
         */
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
          }
        }

        /*
         * 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);
        }

      } else if (InputComponent.NAME.equals(component.getName())
          || DifferedInputComponent.NAME.equals(component.getName())
          || S3InputComponent.NAME.equals(component.getName())
          || OutputComponent.NAME.equals(component.getName())
          || MemoComponent.NAME.equals(component.getName())
          || component instanceof EndDoWhileComponent) {
        // no op
      } else if (component instanceof DoWhileComponent) {
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
          }
        }

        if (controlDone) {
View Full Code Here


          || component instanceof InstanceComponent) {

        /*
         * Check for control ports from other node
         */
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode())
            // amazon component use condition met to check
            // whether the control port is done
            // FIXME I changed the "||" to a "&&" in the following since thats the only this
            // that makes sense and if anyone found a scenario it should be otherwise pls fix
                || ((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);
        }
      } else if (component instanceof EndifComponent) {
        /*
         * EndIfComponent can run if number of input equals to number of
         * output that it expects
         */
        int expectedOutput = node.getOutputPorts().size();
        int actualInput = 0;
        List<DataPort> inputPorts = node.getInputPorts();
        for (DataPort dataPort : inputPorts) {
          if (finishedNodes.contains(dataPort.getFromNode()))
            actualInput++;
        }

        if (expectedOutput == actualInput) {
          list.add(node);
        }
      } else if (component instanceof TerminateInstanceComponent) {
        /*
         * All node connected to controlIn port must be done
         */
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
          }
        }

        /*
         * 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);
        }

      } else if (InputComponent.NAME.equals(component.getName())
          || DifferedInputComponent.NAME.equals(component.getName())
          || S3InputComponent.NAME.equals(component.getName())
          || OutputComponent.NAME.equals(component.getName())
          || MemoComponent.NAME.equals(component.getName())
          || component instanceof EndDoWhileComponent) {
        // no op
      } else if (component instanceof DoWhileComponent) {
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
          }
        }

        if (controlDone) {
View Full Code Here

          || component instanceof InstanceComponent) {

        /*
         * Check for control ports from other node
         */
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode())
            // amazon component use condition met to check
            // whether the control port is done
                || ((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);
        }
      } else if (component instanceof EndifComponent) {
        /*
         * EndIfComponent can run if number of input equals to number of
         * output that it expects
         */
        int expectedOutput = node.getOutputPorts().size();
        int actualInput = 0;
        List<DataPort> inputPorts = node.getInputPorts();
        for (DataPort dataPort : inputPorts) {
          if (finishedNodes.contains(dataPort.getFromNode()))
            actualInput++;
        }

        if (expectedOutput == actualInput) {
          list.add(node);
        }
      } else if (component instanceof TerminateInstanceComponent) {
        /*
         * All node connected to controlIn port must be done
         */
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
          }
        }

        /*
         * 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);
        }

      } else if (InputComponent.NAME.equals(component.getName())
          || DifferedInputComponent.NAME.equals(component.getName())
          || S3InputComponent.NAME.equals(component.getName())
          || OutputComponent.NAME.equals(component.getName())
          || MemoComponent.NAME.equals(component.getName())
          || component instanceof EndDoWhileComponent) {
        // no op
      } else if (component instanceof DoWhileComponent) {
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
          }
        }

        if (controlDone) {
View Full Code Here

  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());
          }
        }
View Full Code Here

            DataPort port = output.createPort();
            node.addOutputPort(port);
        }

        if (this.controlInPort != null) {
            ControlPort port = this.controlInPort.createPort();
            node.setControlInPort(port);
        }

        for (ComponentControlPort componentPort : this.controlOutPorts) {
            ControlPort port = componentPort.createPort();
            node.addControlOutPort(port);
        }

        if (this.eprPort != null) {
            EPRPort port = this.eprPort.createPort();
View Full Code Here

  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());
          }
        }
View Full Code Here

        if (type == EventType.RESOURCE_MAPPING && event.getMessage().contains("i-")) {
            String nodeID = event.getNodeID();
            for (GraphCanvas graphCanvas : graphCanvases) {
                Node node = graphCanvas.getWorkflow().getGraph().getNode(nodeID);
                if (node != null) {
                    ControlPort control = node.getControlInPort();
                    if (control != null) {
                        Node fromNode = control.getFromNode();
                        if (fromNode instanceof InstanceNode) {
                            InstanceNode ec2Node = (InstanceNode) fromNode;

                            /*
                             * parse message and set output to InstanceNode
View Full Code Here

        if (type == EventType.RESOURCE_MAPPING && event.getMessage().contains("i-")) {
            String nodeID = event.getNodeID();
            for (GraphCanvas graphCanvas : graphCanvases) {
                Node node = graphCanvas.getWorkflow().getGraph().getNode(nodeID);
                if (node != null) {
                    ControlPort control = node.getControlInPort();
                    if (control != null) {
                        Node fromNode = control.getFromNode();
                        if (fromNode instanceof InstanceNode) {
                            InstanceNode ec2Node = (InstanceNode) fromNode;

                            /*
                             * parse message and set output to InstanceNode
View Full Code Here

  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());
          }
        }
View Full Code Here

          || component instanceof InstanceComponent) {

        /*
         * Check for control ports from other node
         */
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode())
            // amazon component use condition met to check
            // whether the control port is done
            // FIXME I changed the "||" to a "&&" in the following since thats the only this
            // that makes sense and if anyone found a scenario it should be otherwise pls fix
                || ((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);
        }
      } else if (component instanceof EndifComponent) {
        /*
         * EndIfComponent can run if number of input equals to number of
         * output that it expects
         */
        int expectedOutput = node.getOutputPorts().size();
        int actualInput = 0;
        List<DataPort> inputPorts = node.getInputPorts();
        for (DataPort dataPort : inputPorts) {
          if (finishedNodes.contains(dataPort.getFromNode()))
            actualInput++;
        }

        if (expectedOutput == actualInput) {
          list.add(node);
        }
      } else if (component instanceof TerminateInstanceComponent) {
        /*
         * All node connected to controlIn port must be done
         */
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
          }
        }

        /*
         * 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);
        }

      } else if (InputComponent.NAME.equals(component.getName())
          || DifferedInputComponent.NAME.equals(component.getName())
          || S3InputComponent.NAME.equals(component.getName())
          || OutputComponent.NAME.equals(component.getName())
          || MemoComponent.NAME.equals(component.getName())
          || component instanceof EndDoWhileComponent) {
        // no op
      } else if (component instanceof DoWhileComponent) {
        ControlPort control = node.getControlInPort();
        boolean controlDone = true;
        if (control != null) {
          for (EdgeImpl edge : control.getEdges()) {
            controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
          }
        }

        if (controlDone) {
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.graph.ControlPort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.