Package org.apache.airavata.xbaya.wf

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


    @Test
    public void testScheduleDynamically() throws IOException, URISyntaxException, XBayaException {
        logger.info("Running WorkflowTest...");
        URL systemResource = this.getClass().getClassLoader().getSystemResource("SimpleEcho.xwf");
        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
        ((InputNode) workflow.getGraph().getNode("input")).setDefaultValue("1");
        WorkflowInterpreter interpretor = new WorkflowInterpreter(WorkflowTestUtils.getConfiguration(), UUID.randomUUID().toString(),
                workflow, "NA", "NA",true);
        interpretor.scheduleDynamically();
    }
View Full Code Here


    @Test
    public void testScheduleDynamically() throws IOException, URISyntaxException, XBayaException {
        logger.info("Running ComplexMathWorkflowTest...");
        URL systemResource = this.getClass().getClassLoader().getSystemResource("ComplexMath.xwf");
        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
        WorkflowInterpreter interpretor = new WorkflowInterpreter(WorkflowTestUtils.getConfiguration(), UUID.randomUUID().toString(),
                workflow, "NA", "NA",true);
        interpretor.scheduleDynamically();
    }
View Full Code Here

    public Workflow[] harvest(Workflow workflow, QName dataType) {
        LinkedList<Workflow> harvest = new LinkedList<Workflow>();
        LinkedList<Pair<String, String>> candidates = getCandidates(workflow, dataType);
        for (Pair<String, String> pair : candidates) {
            Workflow clone = workflow.clone();

            NodeImpl node = clone.getGraph().getNode(pair.getLeft());
            if (null == node) {
                throw new XBayaRuntimeException("Specified node not found:" + pair.getLeft());
            }
            Port candidatePort = null;
            List<DataPort> inPorts = node.getInputPorts();
            for (DataPort dataPort : inPorts) {
                if (pair.getRight().equals(dataPort.getID())) {
                    candidatePort = dataPort;
                    break;
                }
            }
            if (null == candidatePort) {
                throw new XBayaRuntimeException("Specifies Port was not found:" + pair.getRight());
            }
            if (!(candidatePort.getFromNode() instanceof InputNode)) {
                removeUnnecessaryNodes(node, candidatePort, clone);
                Node input = clone.addNode(new InputComponent());
                input.setPosition(new Point(Math.max(0, node.getPosition().x - 150), node.getPosition().y));

                // the returned workflows size should be less than that of the
                // original
                if (clone.getGraph().getNodes().size() < workflow.getGraph().getNodes().size()
                // if the sizes the different its a candidate, but need
                // to make sure
                // its not the same as one already harvested
                        && !isWorkflowAlreadyHarvested(harvest, clone)) {
                    try {
                        clone.getGraph().addEdge(input.getOutputPort(0), candidatePort);
                        cleanLeftOverInputNodes(clone);
                    } catch (GraphException e) {
                        throw new RuntimeException(e);
                    }
View Full Code Here

     * @throws GraphException
     * @throws MonitorException
     */
    public Workflow createDifference() throws GraphException, MonitorException {
        WSGraph originalGraph = this.modifiedWorkflow.getGraph();
        Workflow workflow = this.modifiedWorkflow.clone();
        String name = workflow.getName();
        name += " (diff)";
        workflow.setName(name);
        WSGraph graph = workflow.getGraph();

        // Remove the finished node.
        removeFinishedNodes(originalGraph, graph);

        Set<WSPort> originalFromPorts = getFinalOutputPorts(originalGraph, graph);
View Full Code Here

        item.addActionListener(new AbstractAction() {
            public void actionPerformed(ActionEvent event) {
                new Thread() {
                    @Override
                    public void run() {
                        Workflow workflow = new WorkflowFiler(ComponentMenu.this.engine).getWorkflow();
                        // //to normalize and build the scripts
                        try {
                            ComponentMenu.this.engine.addWorkflowComponent(workflow.getName(),
                                    SubWorkflowComponent.getInstance(workflow));

                        } catch (ComponentException e) {
                            ComponentMenu.this.engine.getErrorWindow()
                                    .error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
View Full Code Here

    public boolean triggerAction(JTree tree, String action) throws Exception {
        if (action.equals(DeleteAction.ID)) {
            deleteHostDescription(tree);
            return true;
        } else if (action.equals(ImportAction.ID)) {
          Workflow workflow = new RegistryAccesser(getXBayaEngine()).getWorkflow(getXbayaWorkflow().getWorkflowName());
            GraphCanvas newGraphCanvas = getXBayaEngine().getGUI().newGraphCanvas(true);
            newGraphCanvas.setWorkflow(workflow);
            getXBayaEngine().getGUI().getGraphCanvas().setWorkflowFile(null);
            return true;
        }
View Full Code Here

    private String setupAndLaunch(String workflowAsString, String topic, String password, String username,
                                  NameValue[] inputs,Map<String,String>configurations,boolean inNewThread,WorkflowContextHeaderBuilder builder) throws XMLStreamException {
        System.err.println("Launch is called for topi:");

        Workflow workflow = null;
        try {
            workflow = new Workflow(workflowAsString);
            System.err.println("Workflow Object created");
        } catch (GraphException e1) {
            e1.printStackTrace();
        } catch (ComponentException e1) {
            e1.printStackTrace();
View Full Code Here

     * @throws GraphException
     * @throws IOException
     * @throws ComponentRegistryException
     */
    public void testWorkflow() throws ComponentException, GraphException, IOException, ComponentRegistryException {
        Workflow workflow = createWorkflow();

        File workflowFile = new File("tmp/ADASInitializedWRFForecast.xwf");
        XMLUtil.saveXML(workflow.toXML(), workflowFile);
    }
View Full Code Here

     * @throws GraphException
     * @throws IOException
     * @throws ComponentRegistryException
     */
    public void testPreInvoke() throws ComponentException, GraphException, IOException, ComponentRegistryException {
        Workflow workflow = createWorkflow();
        WorkflowClient.createScript(workflow);

        File workflowWSDLFile = new File("tmp/ADASInitializedWRFForecast-wsdl.xml");
        XMLUtil.saveXML(workflow.getWorkflowWSDL().xml(), workflowWSDLFile);
        File bpelFile = new File("tmp/ADASInitializedWRFForecast-bpel.xml");
        XMLUtil.saveXML(workflow.getGpelProcess().xml(), bpelFile);

        // Get the metadata for input.
        XmlElement inputAppinfo = workflow.getInputMetadata();

        // Get the input information
        List<WSComponentPort> inputs = workflow.getInputs();

        for (WSComponentPort input : inputs) {
            // Show the information of each input.

            // Name
View Full Code Here

        }
    }

    private Workflow createWorkflow() throws ComponentException, GraphException, ComponentRegistryException {

        Workflow workflow = new Workflow();

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

        WSGraph graph = workflow.getGraph();

        LocalComponentRegistry componentRegistry = new LocalComponentRegistry(WSDL_DIRECTORY);

        // WRF_STATIC_PREPROCESSOR_WSDL
        Component wrfPreComp = componentRegistry.getComponent(WRF_STATIC_PREPROCESSOR_WSDL);
        Node wrfPreNode = workflow.addNode(wrfPreComp);
        wrfPreNode.setPosition(new Point(313, 0));

        // TERRAIN_PREPROCESSOR_WSDL
        Component terrainPreComp = componentRegistry.getComponent(TERRAIN_PREPROCESSOR_WSDL);
        Node terrainPreNode = workflow.addNode(terrainPreComp);
        terrainPreNode.setPosition(new Point(59, 289));

        // ADAS_INTERPOLATOR_WSDL
        Component adasIntComp = componentRegistry.getComponent(ADAS_INTERPOLATOR_WSDL);
        Node adasIntNode = workflow.addNode(adasIntComp);
        adasIntNode.setPosition(new Point(373, 235));

        // LATERAL_BOUNDARY_INTERPOLATOR_WSDL
        Component lateralIntComp = componentRegistry.getComponent(LATERAL_BOUNDARY_INTERPOLATOR_WSDL);
        Node lateralIntNode = workflow.addNode(lateralIntComp);
        lateralIntNode.setPosition(new Point(371, 369));

        // ARPS2WRF_INTERPOLATOR_WSDL
        Component arp2wrfComp = componentRegistry.getComponent(ARPS2WRF_INTERPOLATOR_WSDL);
        Node arp2wrfNode = workflow.addNode(arp2wrfComp);
        arp2wrfNode.setPosition(new Point(607, 104));

        // WRF_FORECASTING_MODEL_WSDL
        Component wrfComp = componentRegistry.getComponent(WRF_FORECASTING_MODEL_WSDL);
        Node wrfNode = workflow.addNode(wrfComp);
        wrfNode.setPosition(new Point(781, 14));

        // 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));
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.