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

Examples of org.apache.airavata.workflow.model.graph.system.OutputNode


    } else if (GraphSchema.NODE_TYPE_WORKFLOW.equals(type)) {
      node = new WorkflowNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_INPUT.equals(type)) {
      node = new InputNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_OUTPUT.equals(type)) {
      node = new OutputNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_CONSTANT.equals(type)) {
      node = new ConstantNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_SPLIT.equals(type)) {
      node = new ForEachNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_MERGE.equals(type)) {
View Full Code Here


    /**
     * @see org.apache.airavata.workflow.model.component.Component#createNode(org.apache.airavata.workflow.model.graph.Graph)
     */
    @Override
    public Node createNode(Graph graph) {
        OutputNode node = new OutputNode(graph);

        node.setName(NAME);
        node.setComponent(this);

        // Creates a unique ID for the node. This has to be after setName().
        node.createID();

        // Creates an input port
        createPorts(node);

        return node;
View Full Code Here

      }
    }
    LinkedList<Object> outputValues = new LinkedList<Object>();
    LinkedList<String> outputKeywords = new LinkedList<String>();
    for (Node outputNode : outoutNodes) {
      OutputNode node = (OutputNode) outputNode;
      List<DataPort> inputPorts = node.getInputPorts();
      for (DataPort dataPort : inputPorts) {
        Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
        ;

        if (null == val) {
          throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
        }
        // Some node not yet updated
        if (node.getState() != NodeExecutionState.FINISHED) {
          if (this.config.isActOnProvenance()) {
            try {
              if (val instanceof String) {
                                /**
                                 TODO :  saveWorkflowExecutionOutput() is not implemented in Registry
                                  API or Airavata API at the moment
                                  **/
                this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
              } else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
                this.getConfig()
                    .getConfiguration()
                    .getAiravataAPI().getProvenanceManager()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
                        XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
              }

            } catch (AiravataAPIInvocationException e) {
              e.printStackTrace(); // To change body of catch
                          // statement use File |
                          // Settings | File
                          // Templates.
            }
          }
          if (val instanceof XmlElement) {
            ((OutputNode) node).setDescription(XMLUtil.xmlElementToString((XmlElement) val));
          } else {
            ((OutputNode) node).setDescription(val.toString());
          }
          node.setState(NodeExecutionState.FINISHED);
        }
      }

    }
    this.config.getNotifier().sendingPartialResults(outputValues.toArray(), outputKeywords.toArray(new String[outputKeywords.size()]));
View Full Code Here

      }
    }
    LinkedList<Object> outputValues = new LinkedList<Object>();
    LinkedList<String> outputKeywords = new LinkedList<String>();
    for (Node outputNode : outoutNodes) {
      OutputNode node = (OutputNode) outputNode;
      List<DataPort> inputPorts = node.getInputPorts();
      for (DataPort dataPort : inputPorts) {
        Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
        ;

        if (null == val) {
          throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
        }
        // Some node not yet updated
        if (NodeController.getGUI(node).getBodyColor() != NodeState.FINISHED.color) {
          if (this.config.isActOnProvenance()) {
            try {
              if (val instanceof String) {
                this.getConfig().getConfiguration().getJcrComponentRegistry().getRegistry()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
              } else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
                this.getConfig()
                    .getConfiguration()
                    .getJcrComponentRegistry()
                    .getRegistry()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
                        XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
              }

            } catch (RegistryException e) {
              e.printStackTrace(); // To change body of catch
View Full Code Here

      }
    }
    LinkedList<Object> outputValues = new LinkedList<Object>();
    LinkedList<String> outputKeywords = new LinkedList<String>();
    for (Node outputNode : outoutNodes) {
      OutputNode node = (OutputNode) outputNode;
      List<DataPort> inputPorts = node.getInputPorts();
      for (DataPort dataPort : inputPorts) {
        Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
        ;

        if (null == val) {
          throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
        }
        // Some node not yet updated
        if (node.getState() != NodeExecutionState.FINISHED) {
          if (this.config.isActOnProvenance()) {
            try {
              if (val instanceof String) {
                                /**
                                 TODO :  saveWorkflowExecutionOutput() is not implemented in Registry
                                  API or Airavata API at the moment
                                  **/
                this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
              } else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
                this.getConfig()
                    .getConfiguration()
                    .getAiravataAPI().getProvenanceManager()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
                        XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
              }

            } catch (AiravataAPIInvocationException e) {
              e.printStackTrace(); // To change body of catch
                          // statement use File |
                          // Settings | File
                          // Templates.
            }
          }
          if (val instanceof XmlElement) {
            ((OutputNode) node).setDescription(XMLUtil.xmlElementToString((XmlElement) val));
          } else {
            ((OutputNode) node).setDescription(val.toString());
          }
          node.setState(NodeExecutionState.FINISHED);
        }
      }

    }
    this.config.getNotifier().sendingPartialResults(outputValues.toArray(), outputKeywords.toArray(new String[outputKeywords.size()]));
View Full Code Here

      }
    }
    LinkedList<Object> outputValues = new LinkedList<Object>();
    LinkedList<String> outputKeywords = new LinkedList<String>();
    for (Node outputNode : outoutNodes) {
      OutputNode node = (OutputNode) outputNode;
      List<DataPort> inputPorts = node.getInputPorts();
      for (DataPort dataPort : inputPorts) {
        Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
        ;

        if (null == val) {
          throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
        }
        // Some node not yet updated
        if (node.getState() != NodeExecutionState.FINISHED) {
          if (this.config.isActOnProvenance()) {
            try {
              if (val instanceof String) {
                                /**
                                 TODO :  saveWorkflowExecutionOutput() is not implemented in Registry
                                  API or Airavata API at the moment
                                  **/
                this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
              } else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
                this.getConfig()
                    .getConfiguration()
                    .getAiravataAPI().getProvenanceManager()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
                        XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
              }

            } catch (AiravataAPIInvocationException e) {
              e.printStackTrace(); // To change body of catch
                          // statement use File |
                          // Settings | File
                          // Templates.
            }
          }
          if (val instanceof XmlElement) {
            ((OutputNode) node).setDescription(XMLUtil.xmlElementToString((XmlElement) val));
          } else {
            ((OutputNode) node).setDescription(val.toString());
          }
          node.setState(NodeExecutionState.FINISHED);
        }
      }

    }
    this.config.getNotifier().sendingPartialResults(outputValues.toArray(), outputKeywords.toArray(new String[outputKeywords.size()]));
View Full Code Here

        InputNode paramNode4 = (InputNode) workflow.addNode(this.inputComponent);
        paramNode4.setPosition(new Point(20, 240));
        String paramValue4 = "5";
        paramNode4.setDefaultValue(paramValue4);

        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
        outParamNode.setPosition(new Point(370, 240));

        // Connect ports
        graph.addEdge(paramNode1.getOutputPort(0), adderNode1.getInputPort(0));
        graph.addEdge(paramNode2.getOutputPort(0), adderNode1.getInputPort(1));
        graph.addEdge(paramNode3.getOutputPort(0), adderNode2.getInputPort(0));
        graph.addEdge(paramNode4.getOutputPort(0), adderNode2.getInputPort(1));
        graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
        graph.addEdge(adderNode2.getOutputPort(0), multiNode.getInputPort(1));
        graph.addEdge(multiNode.getOutputPort(0), outParamNode.getInputPort(0));

        return workflow;
    }
View Full Code Here

      }
    }
    LinkedList<Object> outputValues = new LinkedList<Object>();
    LinkedList<String> outputKeywords = new LinkedList<String>();
    for (Node outputNode : outoutNodes) {
      OutputNode node = (OutputNode) outputNode;
      List<DataPort> inputPorts = node.getInputPorts();
      for (DataPort dataPort : inputPorts) {
        Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
        ;

        if (null == val) {
          throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
        }
        // Some node not yet updated
        if (NodeController.getGUI(node).getBodyColor() != NodeState.FINISHED.color) {
          if (this.config.isActOnProvenance()) {
            try {
              if (val instanceof String) {
                this.getConfig().getConfiguration().getJcrComponentRegistry().getRegistry()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
              } else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
                this.getConfig()
                    .getConfiguration()
                    .getJcrComponentRegistry()
                    .getRegistry()
                    .saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
                        XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
              }

            } catch (RegistryException e) {
              e.printStackTrace(); // To change body of catch
View Full Code Here

        // 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>" + "<lsm:constraint type=\"temporalSync\">"
View Full Code Here

        // Input parameter node 2
        InputNode paramNode2 = (InputNode) workflow.addNode(this.inputComponent);
        paramNode2.setPosition(new Point(50, 120));

        // Output parameter
        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
        outParamNode.setPosition(new Point(300, 220));

        // Connect ports
        graph.addEdge(paramNode1.getOutputPort(0), adderNode.getInputPort(0));
        graph.addEdge(paramNode2.getOutputPort(0), adderNode.getInputPort(1));
        graph.addEdge(adderNode.getOutputPort(0), outParamNode.getInputPort(0));

        // Set the default values
        // This needs to be after connection.
        String paramValue1 = "2";
        paramNode1.setDefaultValue(paramValue1);
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.graph.system.OutputNode

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.