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

Examples of org.apache.airavata.workflow.model.graph.Graph


    }

    private void resetAll() {
        List<GraphCanvas> graphCanvases = this.xbayaGUI.getGraphCanvases();
        for (GraphCanvas graphCanvas : graphCanvases) {
            Graph graph = graphCanvas.getGraph();
            for (Node node : graph.getNodes()) {
                resetNode(node);
            }
        }
    }
View Full Code Here


     * @param dscURL
     * @return The Map<partnerLinkName, CWSDL>.
     */
    public static Map<String, WsdlDefinitions> createCWSDLs(Workflow workflow, URI dscURL) {
        Map<String, WsdlDefinitions> WSDLMap = new HashMap<String, WsdlDefinitions>();
        Graph graph = workflow.getGraph();
        for (WSNode node : GraphUtil.getWSNodes(graph)) {
            String partnerLinkName = BPELScript.createPartnerLinkName(node.getID());
            WsdlDefinitions wsdl = node.getComponent().getWSDL();
            if (WSDLUtil.isAWSDL(wsdl)) {
                try {
View Full Code Here

    }

    private void resetAll() {
        List<GraphCanvas> graphCanvases = this.xbayaGUI.getGraphCanvases();
        for (GraphCanvas graphCanvas : graphCanvases) {
            Graph graph = graphCanvas.getGraph();
            for (Node node : graph.getNodes()) {
                resetNode(node);
            }
        }
    }
View Full Code Here

        // Name, description
        workflow.setName("Complex math workflow");
        workflow.setDescription("Complex math workflow");

        Graph graph = workflow.getGraph();

        // Adder nodes
        Component adderComp = this.componentRegistry.getComponents(MATH_ADDER_WSDL).get(0);

        Node adderNode1 = workflow.addNode(adderComp);
        adderNode1.setPosition(new Point(170, 50));

        Node adderNode2 = workflow.addNode(adderComp);
        adderNode2.setPosition(new Point(170, 210));

        // Multiplier node
        Component multiComp = this.componentRegistry.getComponents(MATH_MULTIPLIER_WSDL).get(0);

        Node multiNode = workflow.addNode(multiComp);
        multiNode.setPosition(new Point(320, 130));

        // Parameter node 1
        InputNode paramNode1 = (InputNode) workflow.addNode(this.inputComponent);
        paramNode1.setPosition(new Point(20, 30));
        String paramValue1 = "2";
        paramNode1.setDefaultValue(paramValue1);

        // Parameter node 2
        InputNode paramNode2 = (InputNode) workflow.addNode(this.inputComponent);
        paramNode2.setPosition(new Point(20, 100));
        String paramValue2 = "3";
        paramNode2.setDefaultValue(paramValue2);

        // Parameter node 3
        InputNode paramNode3 = (InputNode) workflow.addNode(this.inputComponent);
        paramNode3.setPosition(new Point(20, 170));
        String paramValue3 = "4";
        paramNode3.setDefaultValue(paramValue3);

        // Parameter node 4
        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

                    .getGraphCanvas()
                    .addNode(
                            ((ComponentTreeNode) ComponentController.getComponentTree(registry).getFirstLeaf()).getComponentReference()
                                    .getComponent(), this.node.getPosition());
            List<DataPort> inputPorts = newNode.getInputPorts();
            Graph graph = this.engine.getGUI().getGraphCanvas().getGraph();
            for (int i = 0; i < inputPorts.size(); ++i) {
                graph.addEdge(this.node.getInputPort(i).getFromPort(), inputPorts.get(i));
            }
            List<DataPort> outputPorts = newNode.getOutputPorts();

            for (int i = 0; i < outputPorts.size(); ++i) {
                List<Port> toPorts = this.node.getOutputPort(i).getToPorts();
                for (Port port : toPorts) {
                    graph.removeEdge(this.node.getOutputPort(i), port);
                    graph.addEdge(outputPorts.get(i), port);
                }

            }

            this.engine.getGUI().getWorkflow().removeNode(this.node);
View Full Code Here

    }

    private void resetAll() {
        List<GraphCanvas> graphCanvases = this.xbayaGUI.getGraphCanvases();
        for (GraphCanvas graphCanvas : graphCanvases) {
            Graph graph = graphCanvas.getGraph();
            for (Node node : graph.getNodes()) {
                resetNode(node);
            }
        }
    }
View Full Code Here

        // Name, description
        workflow.setName("Simple math workflow");
        workflow.setDescription("Simple math workflow");

        Graph graph = workflow.getGraph();

        // Adder node
        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
        Node adderNode = workflow.addNode(adderComp);
        adderNode.setPosition(new Point(250, 100));

        // Input parameter node 1
        InputNode paramNode1 = (InputNode) workflow.addNode(this.inputComponent);
        paramNode1.setPosition(new Point(50, 50));

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

        // Name, description
        workflow.setName("Math workflow");
        workflow.setDescription("A workflow that calculates (a + b) * c.");

        Graph graph = workflow.getGraph();

        // Adder node
        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);

        Node adderNode1 = workflow.addNode(adderComp);
        adderNode1.setPosition(new Point(170, 50));

        // Multiplier node
        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);

        Node multiNode = workflow.addNode(multiComp);
        multiNode.setPosition(new Point(320, 130));

        // Input node 1
        InputNode inputNode1 = (InputNode) workflow.addNode(this.inputComponent);
        inputNode1.setPosition(new Point(20, 30));

        // Input node 2
        InputNode inputNode2 = (InputNode) workflow.addNode(this.inputComponent);
        inputNode2.setPosition(new Point(20, 100));

        // Input node 3
        InputNode inputNode3 = (InputNode) workflow.addNode(this.inputComponent);
        inputNode3.setPosition(new Point(20, 170));

        // Output
        OutputNode outputNode = (OutputNode) workflow.addNode(this.outputComponent);
        outputNode.setPosition(new Point(500, 130));

        // Connect ports
        graph.addEdge(inputNode1.getOutputPort(0), adderNode1.getInputPort(0));
        graph.addEdge(inputNode2.getOutputPort(0), adderNode1.getInputPort(1));
        graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
        graph.addEdge(inputNode3.getOutputPort(0), multiNode.getInputPort(1));
        graph.addEdge(multiNode.getOutputPort(0), outputNode.getInputPort(0));

        // Set the default values
        // This needs to be after connection.
        inputNode1.setConfiguredName("a");
        inputNode2.setConfiguredName("b");
View Full Code Here

        // Name, description
        workflow.setName("Complex math workflow");
        workflow.setDescription("Complex math workflow");

        Graph graph = workflow.getGraph();

        // Adder nodes
        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);

        Node adderNode1 = workflow.addNode(adderComp);
        adderNode1.setPosition(new Point(170, 50));

        Node adderNode2 = workflow.addNode(adderComp);
        adderNode2.setPosition(new Point(170, 210));

        // Multiplier node
        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);

        Node multiNode = workflow.addNode(multiComp);
        multiNode.setPosition(new Point(320, 130));

        // Input node 1
        InputNode inputNode1 = (InputNode) workflow.addNode(this.inputComponent);
        inputNode1.setPosition(new Point(20, 30));

        // Input node 2
        InputNode inputNode2 = (InputNode) workflow.addNode(this.inputComponent);
        inputNode2.setPosition(new Point(20, 100));

        // Input node 3
        InputNode inputNode3 = (InputNode) workflow.addNode(this.inputComponent);
        inputNode3.setPosition(new Point(20, 170));

        // Input node 4
        InputNode inputNode4 = (InputNode) workflow.addNode(this.inputComponent);
        inputNode4.setPosition(new Point(20, 240));

        // Output
        OutputNode outputNode = (OutputNode) workflow.addNode(this.outputComponent);
        outputNode.setPosition(new Point(500, 130));

        // Connect ports
        graph.addEdge(inputNode1.getOutputPort(0), adderNode1.getInputPort(0));
        graph.addEdge(inputNode2.getOutputPort(0), adderNode1.getInputPort(1));
        graph.addEdge(inputNode3.getOutputPort(0), adderNode2.getInputPort(0));
        graph.addEdge(inputNode4.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), outputNode.getInputPort(0));

        // Set the default values
        // This needs to be after connection.
        inputNode1.setConfiguredName("a");
        inputNode2.setConfiguredName("b");
View Full Code Here

        // Name, description
        workflow.setName("Math with const");
        workflow.setDescription("Math with const");

        Graph graph = workflow.getGraph();

        // Adder node
        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
        Node adderNode = workflow.addNode(adderComp);
        adderNode.setPosition(new Point(250, 100));

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

        // Constant node
        ConstantNode constantNode = (ConstantNode) workflow.addNode(this.constantComponent);
        constantNode.setPosition(new Point(50, 120));

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

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

        // Set the default value of an input and the constant.
        // This needs to be after connection.
        String paramValue1 = "2";
        inputNode.setDefaultValue(paramValue1);
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.graph.Graph

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.