Package org.apache.airavata.xbaya.component

Examples of org.apache.airavata.xbaya.component.Component


        WSGraph graph = workflow.getGraph();

        LocalComponentRegistry componentRegistry = new LocalComponentRegistry(WSDL_DIRECTORY);

        // WRF_STATIC_PREPROCESSOR_WSDL
        Component wrfPreComp = componentRegistry.getComponent(WRF_STATIC_PREPROCESSOR_WSDL);
        Node wrfPreNode = workflow.addNode(wrfPreComp);
        wrfPreNode.setPosition(new Point(313, 0));

        // TERRAIN_PREPROCESSOR_WSDL
        Component terrainPreComp = componentRegistry.getComponent(TERRAIN_PREPROCESSOR_WSDL);
        Node terrainPreNode = workflow.addNode(terrainPreComp);
        terrainPreNode.setPosition(new Point(59, 289));

        // ADAS_INTERPOLATOR_WSDL
        Component adasIntComp = componentRegistry.getComponent(ADAS_INTERPOLATOR_WSDL);
        Node adasIntNode = workflow.addNode(adasIntComp);
        adasIntNode.setPosition(new Point(373, 235));

        // LATERAL_BOUNDARY_INTERPOLATOR_WSDL
        Component lateralIntComp = componentRegistry.getComponent(LATERAL_BOUNDARY_INTERPOLATOR_WSDL);
        Node lateralIntNode = workflow.addNode(lateralIntComp);
        lateralIntNode.setPosition(new Point(371, 369));

        // ARPS2WRF_INTERPOLATOR_WSDL
        Component arp2wrfComp = componentRegistry.getComponent(ARPS2WRF_INTERPOLATOR_WSDL);
        Node arp2wrfNode = workflow.addNode(arp2wrfComp);
        arp2wrfNode.setPosition(new Point(607, 104));

        // WRF_FORECASTING_MODEL_WSDL
        Component wrfComp = componentRegistry.getComponent(WRF_FORECASTING_MODEL_WSDL);
        Node wrfNode = workflow.addNode(wrfComp);
        wrfNode.setPosition(new Point(781, 14));

        // Parameters
        Component inputComponent = new InputComponent();
        Component outputComponent = new OutputComponent();

        // Input parameter node
        InputNode confInput = (InputNode) workflow.addNode(inputComponent);
        confInput.setPosition(new Point(0, 100));
View Full Code Here


      Port outputPort = graphPanel.getSelectedOutputPort();
      this.portViewer.setInputPort(inputPort);
      this.portViewer.setOutputPort(outputPort);
      // Reset component viewer.
      Node node = graphPanel.getSelectedNode();
      Component component;
      if (node != null) {
        component = node.getComponent();
      } else {
        component = this.componentSelector.getSelectedComponent();
      }
View Full Code Here

  }

  private void executeDynamically(final Node node) throws XBayaException {
    node.getGUI().setBodyColor(NodeState.EXECUTING.color);
    Component component = node.getComponent();
    if (component instanceof SubWorkflowComponent) {
      handleSubWorkComponent(node);
    } else if (component instanceof WSComponent) {
      handleWSComponent(node);
    } else if (component instanceof DynamicComponent) {
View Full Code Here

  private ArrayList<Node> getReadyNodesDynamically() {
    ArrayList<Node> list = new ArrayList<Node>();
    ArrayList<Node> waiting = InterpreterUtil.getWaitingNodesDynamically(this.graph);
    ArrayList<Node> finishedNodes = InterpreterUtil.getFinishedNodesDynamically(this.graph);
    for (Node node : waiting) {
      Component component = node.getComponent();
      if (component instanceof WSComponent
          || component instanceof DynamicComponent
          || component instanceof SubWorkflowComponent
          || component instanceof ForEachComponent
          || component instanceof EndForEachComponent
          || component instanceof IfComponent
          || 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())) {
        // no op
      } else {
        throw new WorkFlowInterpreterException(
            "Component Not handled :" + component.getName());
      }
    }


    if (this.mode == GUI_MODE) {
View Full Code Here

    /**
     * @see org.apache.airavata.xbaya.graph.impl.NodeImpl#getComponent()
     */
    @Override
    public Component getComponent() {
        Component component = super.getComponent();
        if (component == null) {
            // The component is null when read from the graph XML.
            component = new OutputComponent();
        }
        return component;
View Full Code Here

    /**
     * @see org.apache.airavata.xbaya.graph.impl.NodeImpl#getComponent()
     */
    @Override
    public Component getComponent() {
        Component component = super.getComponent();
        if (component == null) {
            // The component is null when read from the graph XML.
            component = new StreamSourceComponent();
            setComponent(component);
        }
View Full Code Here

        workflow.setDescription("Simple math workflow");

        Graph graph = workflow.getGraph();

        // Adder node
        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
        Node adderNode = workflow.addNode(adderComp);
        adderNode.setPosition(new Point(250, 100));

        // Input parameter node 1
        InputNode paramNode1 = (InputNode) workflow.addNode(this.inputComponent);
View Full Code Here

        workflow.setDescription("A workflow that calculates (a + b) * c.");

        Graph graph = workflow.getGraph();

        // Adder node
        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);

        Node adderNode1 = workflow.addNode(adderComp);
        adderNode1.setPosition(new Point(170, 50));

        // Multiplier node
        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);

        Node multiNode = workflow.addNode(multiComp);
        multiNode.setPosition(new Point(320, 130));

        // Input node 1
View Full Code Here

        workflow.setDescription("Complex math workflow");

        Graph graph = workflow.getGraph();

        // Adder nodes
        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);

        Node adderNode1 = workflow.addNode(adderComp);
        adderNode1.setPosition(new Point(170, 50));

        Node adderNode2 = workflow.addNode(adderComp);
        adderNode2.setPosition(new Point(170, 210));

        // Multiplier node
        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);

        Node multiNode = workflow.addNode(multiComp);
        multiNode.setPosition(new Point(320, 130));

        // Input node 1
View Full Code Here

        workflow.setDescription("Math with const");

        Graph graph = workflow.getGraph();

        // Adder node
        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
        Node adderNode = workflow.addNode(adderComp);
        adderNode.setPosition(new Point(250, 100));

        // Input parameter node
        InputNode inputNode = (InputNode) workflow.addNode(this.inputComponent);
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.component.Component

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.