Package edu.indiana.extreme.xbaya.graph

Examples of edu.indiana.extreme.xbaya.graph.Node


      Object inputVal = findInputFromPort(port);

      /*
       * Need to override inputValue if it is odeClient
       */
      Node fromNode = port.getFromNode();
      if (port.getFromNode() instanceof InputNode) {
        for (WSComponentPort wsComponentPort : inputComponents) {
          if (fromNode.getName().equals(wsComponentPort.getName())) {
            inputVal = odeClient.parseValue(wsComponentPort, (String) inputVal);
          }
        }
      }

View Full Code Here


      Object inputVal = findInputFromPort(dataPort);

      /*
       * Set type after get input value, and override inputValue if output type is array
       */
      Node fromNode = dataPort.getFromNode();
      QName type = null;
      if (fromNode instanceof InputNode) {
        type = BasicTypeMapping.STRING_QNAME;
      } else if (fromNode instanceof ConstantNode) {
        type = ((ConstantNode) fromNode).getType();
View Full Code Here

      throw new WorkFlowInterpreterException("Only one node allowed inside foreach");
    }
    Iterator<Node> iterator = repeatNodes.iterator();
    if (iterator.hasNext()) {

      Node middleNode = iterator.next();

      if (!(middleNode instanceof WSNode)) {
        throw new WorkFlowInterpreterException("Encountered Node inside foreach that is not a WSNode" + middleNode);
      }
      Iterator<Node> endForEachNodeItr = middleNode.getOutputPort(0).getToNodes().iterator();
      while (endForEachNodeItr.hasNext()) {
        Node node2 = endForEachNodeItr.next();
        if (!(node2 instanceof EndForEachNode)) {
          throw new WorkFlowInterpreterException("Found More than one node inside foreach");
        } else {
          endForEachNode = (EndForEachNode) node2;
        }
View Full Code Here

        Object inputVal = findInputFromPort(port);
       
        /*
         * Handle ForEachNode
         */
        Node fromNode = port.getFromNode();
        if (fromNode instanceof ForEachNode) {
          inputVal = input;
        }
       
        if (null == inputVal) {
View Full Code Here

                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));

        // Input parameter node
        InputNode adasInput = (InputNode) workflow.addNode(inputComponent);
        adasInput.setPosition(new Point(286, 145));

        // Input parameter node
        InputNode namInput = (InputNode) workflow.addNode(inputComponent);
        namInput.setPosition(new Point(179, 438));

        // Output parameter
        OutputNode outParamNode = (OutputNode) workflow
                .addNode(outputComponent);
        outParamNode.setPosition(new Point(863, 169));

        // Connect ports
        graph.addEdge(confInput.getOutputPort(0), wrfPreNode.getInputPort(0));
        graph.addEdge(confInput.getOutputPort(0), arp2wrfNode.getInputPort(0));
        graph.addEdge(confInput.getOutputPort(0), adasIntNode.getInputPort(1));
        graph.addEdge(confInput.getOutputPort(0), lateralIntNode
                .getInputPort(1));
        graph.addEdge(confInput.getOutputPort(0), terrainPreNode
                .getInputPort(0));
        graph.addEdge(terrainPreNode.getOutputPort(0), adasIntNode
                .getInputPort(2));
        graph.addEdge(terrainPreNode.getOutputPort(0), lateralIntNode
                .getInputPort(0));
        graph.addEdge(adasInput.getOutputPort(0), adasIntNode.getInputPort(0));
        graph
                .addEdge(namInput.getOutputPort(0), lateralIntNode
                        .getInputPort(2));
        graph.addEdge(wrfPreNode.getOutputPort(0), arp2wrfNode.getInputPort(1));
        graph
                .addEdge(adasIntNode.getOutputPort(0), arp2wrfNode
                        .getInputPort(2));
        graph.addEdge(lateralIntNode.getOutputPort(0), arp2wrfNode
                .getInputPort(3));
        graph.addEdge(arp2wrfNode.getOutputPort(0), wrfNode.getInputPort(0));
        graph.addEdge(wrfNode.getOutputPort(0), outParamNode.getInputPort(0));

        // Add metadata
        String inputMetadata = "<appinfo "
                + "xmlns:lsm=\"http://www.extreme.indiana.edu/namespaces/2006/lead-service-metadata\">"
                + "<lsm:constraints>"
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();
    }
    this.componentViewer.setComponent(component);
View Full Code Here

    public void graphCanvasChanged(GraphCanvasEvent event) {
        GraphCanvasEventType type = event.getType();
        GraphCanvas graphCanvas = event.getGraphCanvas();
        switch (type) {
        case NODE_SELECTED:
            Node node = graphCanvas.getSelectedNode();
            if (node == null) {
                setComponent(null);
            } else {
                setComponent(node.getComponent());
            }
            break;
        case GRAPH_LOADED:
        case NAME_CHANGED:
        case INPUT_PORT_SELECTED:
View Full Code Here

     * handle it explicitly
     */
    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

  protected void edgeWasAdded(Edge edge) throws GraphException {
    super.edgeWasAdded(edge);

    if (edge instanceof ControlEdge) {
      Port toPort = edge.getToPort();
      Node toNode = toPort.getNode();
      /*
       * check if there is already more than instance node connecting to
       * destination node
       */
      if (!(toNode instanceof InstanceNode)) {
        for (Node node : toNode.getControlInPort().getFromNodes()) {
          if ((node instanceof InstanceNode) && this != node) {
            throw new GraphException("Cannot connect more than one instance node to another node.");
          }
        }
      }
View Full Code Here

      WSGraph graph) {
    // TODO Auto-generated method stub
    if (-1 == instanceName.indexOf("Control_")) {
      EventType type = event.getType();
      String nodeID = event.getNodeID();
      Node node = graph.getNode(nodeID);
      if (type == MonitorUtil.EventType.WORKFLOW_INVOKED) {
        // workflowStarted(graph, forward);
        LinkedList<InputNode> inputNodes = getInputNodes(graph);
        for (InputNode inputNode : inputNodes) {
          inputNode.getGUI().setToken(instanceName,
              NodeState.FINISHED);
        }
      } else if (type == MonitorUtil.EventType.WORKFLOW_INITIALIZED) {
        // workflowStarted(graph, forward);
        LinkedList<InputNode> inputNodes = getInputNodes(graph);
        for (InputNode inputNode : inputNodes) {
          inputNode.getGUI().setToken(instanceName,
              NodeState.FINISHED);
        }
      } else if (type == MonitorUtil.EventType.WORKFLOW_TERMINATED) {
        LinkedList<OutputNode> outputNodes = getOutputNodes(graph);
        for (OutputNode outputNode : outputNodes) {
          outputNode.getGUI().setToken(instanceName,
              NodeState.EXECUTING);
        }
      } else if (type == EventType.INVOKING_SERVICE
      // TODO this should be removed when GPEL sends all notification
          // correctly.
          || type == EventType.SERVICE_INVOKED) {
        if (node == null) {
          logger.warning("There is no node that has ID, " + nodeID);
        } else {
          node.getGUI().setToken(instanceName, NodeState.EXECUTING);
        }
      } else if (type == MonitorUtil.EventType.RECEIVED_RESULT
      // TODO this should be removed when GPEL sends all notification
          // correctly.
          || type == EventType.SENDING_RESULT) {
        if (node == null) {
          logger.warning("There is no node that has ID, " + nodeID);
        } else {
          node.getGUI().setToken(instanceName, NodeState.FINISHED);
        }
      } else if (type == EventType.INVOKING_SERVICE_FAILED
          || type == EventType.RECEIVED_FAULT
          // TODO
          || type == EventType.SENDING_FAULT
          || type == EventType.SENDING_RESPONSE_FAILED) {
        if (node == null) {
          logger.warning("There is no node that has ID, " + nodeID);
        } else {
          node.getGUI().setToken(instanceName, NodeState.FAILED);
        }
      } else if (type == MonitorUtil.EventType.RESOURCE_MAPPING) {
        if (node == null) {
          logger.warning("There is no node that has ID, " + nodeID);
        } else {
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.xbaya.graph.Node

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.