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

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


        paramNode1.setPosition(new Point(50, 50));
        String paramValue1 = "300";
        paramNode1.setDefaultValue(paramValue1);

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

        // Connect ports
        graph.addEdge(paramNode1.getOutputPort(0), gfacNode.getInputPort(0));
        graph.addEdge(gfacNode.getOutputPort(0), outParamNode.getInputPort(0));

        return workflow;
    }
View Full Code Here


        // endif
        Node endif = workflow.addNode(this.endifComponent);
        endif.setPosition(new Point(550, 100));

        // Output
        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
        output.setPosition(new Point(700, 100));

        // Connect ports
        graph.addEdge(amount.getOutputPort(0), approver.getInputPort(0));
        graph.addEdge(amount.getOutputPort(0), ifNode.getInputPort(0));
        graph.addEdge(ifNode.getControlOutPorts().get(0), approver.getControlInPort());
        graph.addEdge(ifNode.getControlOutPorts().get(1), constYes.getControlInPort());
        graph.addEdge(approver.getOutputPort(0), endif.getInputPort(0));
        graph.addEdge(constYes.getOutputPort(0), endif.getInputPort(1));
        graph.addEdge(endif.getOutputPort(0), output.getInputPort(0));

        // Set the default values
        // This needs to be after connection.
        amount.setDefaultValue("500");
        constYes.setValue("Yes");
        ifNode.setXPath("$0 > 1000");
        output.setConfiguredName("accept");
        output.setConfigured(true);

        return workflow;
    }
View Full Code Here

        // endif
        Node endDoWhile = workflow.addNode(this.endDoWhileComponent);
        endDoWhile.setPosition(new Point(550, 100));

        // Output
        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
        output.setPosition(new Point(700, 100));

        // Connect ports
        graph.addEdge(amount.getOutputPort(0), approver.getInputPort(0));
        graph.addEdge(amount.getOutputPort(0), doWhileNode.getInputPort(0));
        graph.addEdge(doWhileNode.getControlOutPorts().get(0), approver.getControlInPort());
        graph.addEdge(doWhileNode.getControlOutPorts().get(1), constYes.getControlInPort());
        graph.addEdge(approver.getOutputPort(0), endDoWhile.getInputPort(0));
        graph.addEdge(constYes.getOutputPort(0), endDoWhile.getInputPort(1));
        graph.addEdge(endDoWhile.getOutputPort(0), output.getInputPort(0));

        // Set the default values
        // This needs to be after connection.
        amount.setDefaultValue("0");
        constYes.setValue("Yes");
        doWhileNode.setXpath("$1 = 1");
        output.setConfiguredName("accept");
        output.setConfigured(true);

        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 (node.getState().equals(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());
          }
                    outputValues.add(val);
                    outputKeywords.add(dataPort.getID());
          node.setState(NodeExecutionState.FINISHED);
        }
      }

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

        for (int i = 0; i < this.inputNodes.size(); i++) {
            InputNode inputNode = this.inputNodes.get(i);
            Collections.swap(this.nodes, i, this.nodes.indexOf(inputNode));
        }
        for (int i = 0; i < this.outputNodes.size(); i++) {
            OutputNode outputNode = this.outputNodes.get(i);
            Collections.swap(this.nodes, this.inputNodes.size() + i, this.nodes.indexOf(outputNode));
        }
        hide();
    }
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.