Package org.apache.airavata.xbaya.wf

Examples of org.apache.airavata.xbaya.wf.Workflow


     * @throws XBayaException
     */
    public void testRun() throws XBayaException {

        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createComplexMathWorkflow();
        JythonScript script = new JythonScript(workflow, this.configuration);
        script.create();
        String jythonString = script.getJythonString();

        AdderService adder = new AdderService();
View Full Code Here


    /**
     * @throws IOException
     * @throws XBayaException
     */
    public void testSimpleMath() throws IOException, XBayaException {
        Workflow workflow = this.workflowCreator.createSimpleMathWorkflow();
        JythonScript script = new JythonScript(workflow, this.configuration);
        script.create();
        String jythonString = script.getJythonString();
        String filename = "tmp/simple-math.py";
        IOUtil.writeToFile(jythonString, filename);
View Full Code Here

    /**
     * @throws IOException
     * @throws XBayaException
     */
    public void testComplexMath() throws IOException, XBayaException {
        Workflow workflow = this.workflowCreator.createComplexMathWorkflow();
        JythonScript script = new JythonScript(workflow, this.configuration);
        script.create();
        String jythonString = script.getJythonString();
        String filename = "tmp/complex-math.py";
        IOUtil.writeToFile(jythonString, filename);
View Full Code Here

    /**
     * @throws IOException
     * @throws XBayaException
     */
    public void testArray() throws IOException, XBayaException {
        Workflow workflow = this.workflowCreator.createArrayWorkflow();
        JythonScript script = new JythonScript(workflow, this.configuration);
        script.create();
        String jythonString = script.getJythonString();
        String filename = "tmp/array-test.py";
        IOUtil.writeToFile(jythonString, filename);
View Full Code Here

     * @throws XBayaException
     */
    public void testRun() throws XBayaException {

        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createComplexMathWorkflow();
        JythonScript script = new JythonScript(workflow, this.configuration);
        script.create();
        String jythonString = script.getJythonString();

        AdderService adder = new AdderService();
View Full Code Here

    }

    public void openWorkflowTab(XBayaEngine engine) {
        WorkflowClient workflowClient = engine.getWorkflowClient();
        try {
            Workflow workflow = this.node.getComponent().getWorkflow(workflowClient);
            engine.getGUI().selectOrCreateGraphCanvas(workflow);
        } catch (GraphException e) {
            engine.getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
        } catch (WorkflowEngineException e) {
            engine.getErrorWindow().error(ErrorMessages.GPEL_ERROR, e);
View Full Code Here

    return null;
  }

  public void setInputs(Properties inputList) {
    try {
      Workflow workflow = new Workflow(this.workflow);
      List<WSComponentPort> inputs = workflow.getInputs();
      for (WSComponentPort input : inputs) {
        input.setValue(inputList.getProperty(input.getName()));
      }
    } catch (GraphException e) {
      e.printStackTrace(); // To change body of catch statement use File |
View Full Code Here

     * @throws ComponentException
     * @throws GraphException
     * @throws ComponentRegistryException
     */
    public Workflow createForEachWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
        Workflow workflow = new Workflow();

        // Name, description
        workflow.setName("ForEach test");
        workflow.setDescription("Workflow that tests if");

        Graph graph = workflow.getGraph();

        // x
        InputNode inputX = (InputNode) workflow.addNode(this.inputComponent);
        inputX.setPosition(new Point(0, 0));

        // n
        InputNode inputN = (InputNode) workflow.addNode(this.inputComponent);
        inputN.setPosition(new Point(0, 80));

        // Array generator
        Component arrayGeneratorComponent = this.componentRegistry.getComponent(ArrayGenerator.WSDL_PATH);
        Node arrayGenerator = workflow.addNode(arrayGeneratorComponent);
        arrayGenerator.setPosition(new Point(120, 80));

        // Split
        Node split = workflow.addNode(this.splitComponent);
        split.setPosition(new Point(310, 80));

        // Adder
        Component adderComponent = this.componentRegistry.getComponent(Adder.WSDL_PATH);
        Node adder = workflow.addNode(adderComponent);
        adder.setPosition(new Point(440, 40));

        // Merge
        Node merge = workflow.addNode(this.mergeComponent);
        merge.setPosition(new Point(580, 40));

        // Output
        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
        output.setConfiguredName("output");
        output.setPosition(new Point(720, 40));

        // Connect ports
        graph.addEdge(inputX.getOutputPort(0), adder.getInputPort(0));
View Full Code Here

    /**
   *
   */
    public void save() {
        Workflow wf = this.engine.getWorkflow();
        if (0 == wf.getGraph().getNodes().size()) {
            this.engine.getErrorWindow().warning("Workflow is Empty");
            return;
        }
        GpelProcess process;
        try {

            int returnVal = this.bpelFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = this.bpelFileChooser.getSelectedFile();

                String path = file.getPath();

                // Remove ".bpel" at the end if any
                if (path.endsWith(XBayaConstants.BPEL_SUFFIX)) {
                    path = path.substring(0, path.length() - XBayaConstants.BPEL_SUFFIX.length());
                }

                // Add ".bpel" at the end of the file name
                File bpelFile = new File(path + XBayaConstants.BPEL_SUFFIX);
                // Add ".wsdl" at the end of the file name
                File wsdlFile = new File(path + XBayaConstants.WSDL_SUFFIX);
                // todo this has to fix, for compilation purpose passing dummy value instead of xregistry url
                URI temp = null;
                try {
                    temp = new URI("temp");
                } catch (URISyntaxException e) {
                    e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
                }
                process = wf.getOdeProcess(WSDLUtil.appendWSDLQuary(temp), this.engine.getConfiguration().getODEURL());
                String processString = process.xmlStringPretty();
                FileWriter writer = new FileWriter(bpelFile);
                writer.write(processString);
                writer.close();

                WsdlDefinitions workflowWSDL = wf.getOdeWorkflowWSDL(this.engine.getConfiguration().getDSCURL(),
                        this.engine.getConfiguration().getODEURL());
                String workflowWsdlStr = XmlConstants.BUILDER.serializeToStringPretty(workflowWSDL.xml());
                writer = new FileWriter(wsdlFile);
                writer.write(workflowWsdlStr);

                Map<String, WsdlDefinitions> wsdlMap = wf.getOdeServiceWSDLs(
                        this.engine.getConfiguration().getDSCURL(), this.engine.getConfiguration().getODEURL());
                Set<String> keySet = wsdlMap.keySet();
                for (String string : keySet) {
                    writer = new FileWriter(new File(wsdlFile.getParent(), QName.valueOf(string).getLocalPart()));
                    writer.write(XmlConstants.BUILDER.serializeToStringPretty(wsdlMap.get(string).xml()));
                    writer.close();
                }

                XmlElement deployDescriptor = wf.getODEDeploymentDescriptor(this.engine.getConfiguration().getDSCURL(),
                        this.engine.getConfiguration().getODEURL());
                writer = new FileWriter(new File(wsdlFile.getParent(), "deploy.xml"));
                writer.write(XmlConstants.BUILDER.serializeToString(deployDescriptor));
                writer.close();

View Full Code Here

  private List<WSComponentPort> getWSComponentPortInputs(
      String workflowTemplateId) throws RegistryException,
      PathNotFoundException, RepositoryException, GraphException,
      ComponentException, ValueFormatException {
    Property workflowAsString = getWorkflowAsString(workflowTemplateId);
    Workflow workflow = new Workflow(workflowAsString.getString());
    WorkflowClient.createScript(workflow);
    List<WSComponentPort> inputs = workflow.getInputs();
    return inputs;
  }
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.wf.Workflow

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.