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

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


        Node approver = workflow.addNode(approverComponent);
        approver.setPosition(new Point(350, 10));

        // const
        ConstantNode constYes = (ConstantNode) workflow.addNode(this.constantComponent);
        constYes.setPosition(new Point(350, 200));

        // 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


        Node approver = workflow.addNode(approverComponent);
        approver.setPosition(new Point(350, 10));

        // const
        ConstantNode constYes = (ConstantNode) workflow.addNode(this.constantComponent);
        constYes.setPosition(new Point(350, 200));

        // 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

TOP

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

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.