Package org.apache.airavata.xbaya.graph.system

Examples of org.apache.airavata.xbaya.graph.system.InputNode


                // This should not happen.
                throw new XBayaRuntimeException(originalFromNode.getClass().getName());
            }
            Port originalToPort = originalFromPort.getToPorts().get(0);
            PortImpl toPort = graph.getPort(originalToPort.getID());
            InputNode inputNode = (InputNode) toPort.getFromNode();
            inputNode.setDefaultValue(output);
        }

        return workflow;
    }
View Full Code Here


     * @throws GraphException
     */
    private void createInputNodes(WSGraph graph, Set<WSPort> originalFromPorts) throws GraphException {
        InputComponent inputComponent = new InputComponent();
        for (WSPort originalFromPort : originalFromPorts) {
            InputNode inputNode = inputComponent.createNode(graph);
            List<Port> originalToPorts = originalFromPort.getToPorts();
            boolean first = true;
            for (Port originalToPort : originalToPorts) {
                String toPortID = originalToPort.getID();
                Port toPort = graph.getPort(toPortID);
                graph.addEdge(inputNode.getPort(), toPort);
                if (first) {
                    first = false;
                    Point position = originalToPort.getGUI().getPosition();
                    Point inputNodePosition = new Point(0, position.y);
                    inputNode.setPosition(inputNodePosition);
                }
            }
        }
    }
View Full Code Here

    /**
     * @see org.apache.airavata.xbaya.component.Component#createNode(org.apache.airavata.xbaya.graph.Graph)
     */
    @Override
    public InputNode createNode(Graph graph) {
        InputNode node = new InputNode(graph);
        node.setName(NAME);
        node.setComponent(this);

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

        // Creates a output port
        createPorts(node);

        return node;
View Full Code Here

        // Parameters
        Component inputComponent = new InputComponent();
        Component outputComponent = new OutputComponent();

        // Input parameter node
        InputNode confInput = (InputNode) workflow.addNode(inputComponent);
        confInput.setPosition(new Point(0, 100));

        // Input parameter node
        InputNode adasInput = (InputNode) workflow.addNode(inputComponent);
        adasInput.setPosition(new Point(286, 145));

        // 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));
View Full Code Here

        this.graph.setOutputMetadata(outputMetadata);

        // Sort the nodes in the graph in the order of sorted inputs, sorted
        // outputs, and the rest.
        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));
View Full Code Here

        // TODO error check for user inputs

        List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
        for (int i = 0; i < inputNodes.size(); i++) {
            InputNode inputNode = inputNodes.get(i);
            XBayaTextField parameterTextField = this.parameterTextFields.get(i);
            String id = inputNode.getID();
            String value = parameterTextField.getText();
            arguments.add("-" + id);
            arguments.add(value);
        }
View Full Code Here

        // TODO error check for user inputs

        List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
        final org.xmlpull.v1.builder.XmlElement inputs = builder.newFragment("inputs");
        for (int i = 0; i < inputNodes.size(); i++) {
            InputNode inputNode = inputNodes.get(i);
            XBayaTextField parameterTextField = this.parameterTextFields.get(i);
            String id = inputNode.getID();
            String value = parameterTextField.getText();
            org.xmlpull.v1.builder.XmlElement input = inputs.addElement(id);
            input.addChild(value);
        }
View Full Code Here

        //
        // Add default value if it's input.
        //
        if (node instanceof InputNode) {
            InputNode inputNode = (InputNode) node;
            Object value = inputNode.getDefaultValue();
            if (value instanceof String) {
                element.setAttributeValue(WSConstants.DEFAULT_ATTRIBUTE, (String) value);
            } else if (value instanceof XmlElement) {
                // Add the default value in <annotation><default> because there
                // is no standard way.
View Full Code Here

        final List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
        builder.newFragment("inputs");
        new ODEClient();
        for (int i = 0; i < inputNodes.size(); i++) {
            InputNode inputNode = inputNodes.get(i);
            XBayaTextField parameterTextField = this.parameterTextFields.get(i);
            inputNode.getID();
            String value = parameterTextField.getText();
            inputNode.setDefaultValue(value);
        }

        final String workflowInterpreterUrl = this.workflowInterpreterTextField.getText();
        if (null != workflowInterpreterUrl && !"".equals(workflowInterpreterUrl)) {
            try {
                this.engine.getConfiguration().setWorkflowInterpreterURL(new URI(workflowInterpreterUrl));
            } catch (URISyntaxException e) {
                this.engine.getErrorWindow().error(e);
            }
        }

        final String gFacUrl = this.gfacTextField.getText();
        if (null != gFacUrl && !"".equals(gFacUrl)) {
            try {
                this.engine.getConfiguration().setGFacURL(new URI(gFacUrl));
            } catch (URISyntaxException e) {
                this.engine.getErrorWindow().error(e);
            }
        }
        this.engine.getConfiguration().setTopic(topic);

        final String topicString = topic;
        new Thread() {
            /**
             * @see java.lang.Thread#run()
             */
            @Override
            public void run() {

                try {
                    WorkflowInterpreterLaunchWindow.this.engine.getMonitor().getConfiguration().setTopic(topicString);

                    WorkflowInterpreterLaunchWindow.this.engine.getMonitor().start();
                } catch (MonitorException e1) {
                    WorkflowInterpreterLaunchWindow.this.engine.getErrorWindow().error(e1);
                }
                try {

                    WorkflowInterpretorStub stub = new WorkflowInterpretorStub(engine.getConfiguration()
                            .getWorkflowInterpreterURL().toString());
                    NameValue[] configurations = new NameValue[6];
                    configurations[0] = new NameValue();
                    configurations[0].setName(HeaderConstants.HEADER_ELEMENT_GFAC);
                    configurations[0].setValue(engine.getConfiguration().getGFacURL().toString());
                    configurations[1] = new NameValue();
                    configurations[1].setName(HeaderConstants.HEADER_ELEMENT_REGISTRY);
                    if (null == engine.getConfiguration().getRegistryURL()) {
                        configurations[1].setValue(XBayaConstants.REGISTRY_URL.toString());
                    } else {
                        configurations[1].setValue(engine.getConfiguration().getRegistryURL().toString());
                    }
                    configurations[2] = new NameValue();
                    configurations[2].setName(HeaderConstants.HEADER_ELEMENT_PROXYSERVER);
                    configurations[2].setValue(engine.getConfiguration().getMyProxyServer());

                    configurations[3] = new NameValue();
                    configurations[3].setName(HeaderConstants.HEADER_ELEMENT_BROKER);
                    configurations[3].setValue(engine.getConfiguration().getBrokerURL().toString());

                    configurations[4] = new NameValue();
                    configurations[4].setName(HeaderConstants.HEADER_ELEMENT_MSGBOX);
                    configurations[4].setValue(engine.getConfiguration().getMessageBoxURL().toString());

                    configurations[5] = new NameValue();
                    configurations[5].setName(HeaderConstants.HEADER_ELEMENT_DSC);
                    configurations[5].setValue(engine.getConfiguration().getDSCURL().toString());

                    NameValue[] inputNameVals = new NameValue[inputNodes.size()];
                    for (int i = 0; i < inputNodes.size(); i++) {
                        inputNameVals[i] = new NameValue();
                        InputNode inputNode = inputNodes.get(i);
                        String id = inputNode.getID();
                        String value = inputNode.getDefaultValue().toString();
                        inputNameVals[i].setName(id);
                        inputNameVals[i].setValue(value);
                    }
                    XBayaConfiguration configuration = engine.getConfiguration();
                    String myProxyUsername = configuration.getRegistryUserName();
View Full Code Here

        } else if (GraphSchema.NODE_TYPE_STREAM_SOURCE.equals(type)) {
            node = new StreamSourceNode(nodeElement);
        } 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)) {
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.graph.system.InputNode

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.