Package edu.indiana.extreme.xbaya.workflow

Examples of edu.indiana.extreme.xbaya.workflow.WorkflowClient


       
       
        this.parameterPanel.getContentPanel().removeAll();
        this.parameterTextFields.clear();

        WorkflowClient workflowClient = this.engine.getWorkflowClient();
        if (workflowClient.isSecure()) {
            // Check if the proxy is loaded.
            boolean loaded = this.myProxyChecker.loadIfNecessary();
            if (!loaded) {
                return;
            }
            // Creates a secure channel in gpel.
            MyProxyClient myProxyClient = this.engine.getMyProxyClient();
            GSSCredential proxy = myProxyClient.getProxy();
            UserX509Credential credential = new UserX509Credential(
                    proxy, XBayaSecurity.getTrustedCertificates());
            try {
                workflowClient.setUserX509Credential(credential);
            } catch (WorkflowEngineException e) {
                this.engine.getErrorWindow().error(ErrorMessages.GPEL_ERROR, e);
                return;
            }
        }
View Full Code Here


            WorkflowEngineException, ComponentRegistryException {
        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createComplexMathWorkflow();
        workflow.setName("this is test name");
        workflow.setDescription("this is test description");
        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);

        client.createScriptAndDeploy(workflow, false);

        GcSearchList list = client.list();
        for (GcSearchResult result : list.results()) {
            logger.info(result.getTitle());
        }

        client.load(workflow.getGPELTemplateID());
    }
View Full Code Here

     */
    public void XtestRedeploy() throws ComponentException, GraphException,
            WorkflowEngineException, ComponentRegistryException {
        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createComplexMathWorkflow();
        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);

        client.createScriptAndDeploy(workflow, false);

        client.createScriptAndDeploy(workflow, true);
    }
View Full Code Here

    /**
     * @throws WorkflowEngineException
     */
    public void XtestListWorkflowInstances() throws WorkflowEngineException {
        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);
        GcSearchList searchList = client.list(100, WorkflowType.INSTANCE);
        for (GcSearchResult result : searchList.results()) {
            URI id = result.getId();
            logger.info("id: " + id);
        }
    }
View Full Code Here

        // The URL of the GPEL Engine.
        URI gpelEngineURL = XBayaConstants.DEFAULT_GPEL_ENGINE_URL;

        // Create a client.
        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(gpelEngineURL);

        // XXX This is supposed to return the workflow templates related to the
        // user only. But users are not implemented in GPEL yet.
        GcSearchList results = client.list();

        for (GcSearchResult result : results.results()) {

            // The title to show to the user.
            String title = result.getTitle();
View Full Code Here

    public void XtestStart() throws ComponentException, GraphException,
            WorkflowEngineException, ComponentRegistryException {
        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow = creator.createSimpleMathWorkflow();

        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);

        client.createScriptAndDeploy(workflow, false);

        // Instantiate the workflow template.
        GcInstance instance = client.instantiate(workflow, this.configuration
                .getDSCURL());

        // Start the workflow instance.
        WsdlDefinitions wsdl = client.start(instance);

        logger.info(wsdl.xmlStringPretty());
    }
View Full Code Here

     */
    public void testLoadInstance() throws XBayaException {
        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow0 = creator.createComplexMathWorkflow();

        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);

        // Deploy
        URI templateID = client.createScriptAndDeploy(workflow0, false);

        // Load a workflow template from the GPEL Engine.
        Workflow workflowTemplate = client.load(templateID);

        // Instantiate the workflow template.
        GcInstance instance = client.instantiate(workflowTemplate,
                this.configuration.getDSCURL());
        // ID to retrieve the workflow instance
        URI instanceID = instance.getInstanceId();
        logger.info("instanceID: " + instanceID);

        // Start the workflow instance.
        // WsdlDefinitions wsdl = client.start(instance);

        Workflow workflowInstance = client.load(instanceID,
                WorkflowType.INSTANCE);
        assertNotNull(workflowInstance);
    }
View Full Code Here

    public void XtestInvoke() throws XBayaException {

        WorkflowCreator creator = new WorkflowCreator();
        Workflow workflow0 = creator.createGFacWorkflow();

        WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
        client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);

        URI templateID = client.createScriptAndDeploy(workflow0, false);

        // Load a workflow template from the GPEL Engine.
        Workflow workflow = client.load(templateID);

        // Get the metadata for input.
        XmlElement inputAppinfo = workflow.getInputMetadata();
        logger
                .info("inputAppinfo: "
                        + XMLUtil.xmlElementToString(inputAppinfo));

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

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

            // Name
            String name = input.getName();
            logger.info("name: " + name);

            // Type
            QName type = input.getType();
            logger.info("type: " + type);

            // Metadata as XML
            XmlElement appinfo = input.getAppinfo();
            logger.info("appinfo: " + XMLUtil.xmlElementToString(appinfo));
            if (appinfo != null) {
                // Parse the simple case.
                for (XmlElement element : appinfo.requiredElementContent()) {
                    String tag = element.getName();
                    String value = element.requiredText();
                    logger.info(tag + " = " + value);
                }
            }

            // Set a value to each input.
            input.setValue("200");
        }

        // Instantiate the workflow template.
        GcInstance instance = client.instantiate(workflow, this.configuration
                .getDSCURL());
        // ID to retrieve the workflow instance
        URI instanceID = instance.getInstanceId();
        logger.info("instanceID: " + instanceID);

        // Start the workflow instance.
        WsdlDefinitions wsdl = client.start(instance);

        // Create lead context.
        LeadContextHeaderHelper leadContextHelper = new LeadContextHeaderHelper();
        leadContextHelper.setXBayaConfiguration(this.configuration);
        LeadContextHeader leadContext = leadContextHelper
View Full Code Here

                    .loadCertificates(trustedcerts));
        } else {
            // Using service certificate.
            credential = new UserX509Credential(certskey, trustedcerts);
        }
        WorkflowClient client = WorkflowEngineManager.getWorkflowClient(engineURL, credential);
        assertNotNull(client);
    }
View Full Code Here

                        .getMyLeadUser(), this.configuration.getMyLeadProject());
        MyLead myLead = new MyLead(myleadConfig, proxy);

        UserX509Credential gpelUserCredential = new UserX509Credential(
                proxy, XBayaSecurity.getTrustedCertificates());
        WorkflowClient gpelClient = WorkflowEngineManager.getWorkflowClient(XBayaConstants.DEFAULT_GPEL_ENGINE_URL, gpelUserCredential);
        gpelClient.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);

        WorkflowCreator workflowCreator = new WorkflowCreator();
        Workflow workflow = workflowCreator.createSimpleMathWorkflow();

        gpelClient.createScriptAndDeploy(workflow, false);

        logger.info("template ID: " + workflow.getUniqueWorkflowName());

        String resourceID = myLead.save(workflow, false);

        logger.info("resourceID: " + resourceID);

        URI templateID2 = myLead.load(resourceID);

        Workflow workflow2 = gpelClient.load(templateID2);

        logger.info("workflow name: " + workflow2.getName());
        assertEquals(workflow.getName(), workflow2.getName());
    }
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.xbaya.workflow.WorkflowClient

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.