Package org.apache.ode.bpel.iapi

Examples of org.apache.ode.bpel.iapi.ProcessConf


    QName qName2 = new QName("http://ode/bpel/unit-test", "HelloWorld2-2");
    QName qName3 = new QName("http://ode/bpel/unit-test", "HelloWorld2-3");

    @Test public void testRetireOld() throws Throwable {
        deploy("/bpel/2.0/TestVersionedRedeploy/HelloWorld-1");
        ProcessConf conf = store.getProcessConfiguration(qName1);
        Assert.assertEquals(ProcessState.ACTIVE, conf.getState());

        deploy("/bpel/2.0/TestVersionedRedeploy/HelloWorld-2");

        // Now 1 should be retired and 2 active
        conf = store.getProcessConfiguration(qName1);
        Assert.assertEquals(ProcessState.RETIRED, conf.getState());
        conf = store.getProcessConfiguration(qName2);
        Assert.assertEquals(ProcessState.ACTIVE, conf.getState());

        deploy("/bpel/2.0/TestVersionedRedeploy/HelloWorld-3");

        // 1 and 2 should be retired and 3 active
        conf = store.getProcessConfiguration(qName1);
        Assert.assertEquals(ProcessState.RETIRED, conf.getState());
        conf = store.getProcessConfiguration(qName2);
        Assert.assertEquals(ProcessState.RETIRED, conf.getState());
        conf = store.getProcessConfiguration(qName3);
        Assert.assertEquals(ProcessState.ACTIVE, conf.getState());
    }
View Full Code Here


                        response.addChild(nameElmt);
                    }
                    sendResponse(factory, messageContext, "listProcessesResponse", response);
                } else if (operation.equals("getProcessPackage")) {
                    OMElement qnamePart = messageContext.getEnvelope().getBody().getFirstElement().getFirstElement();
                    ProcessConf process = _store.getProcessConfiguration(OMUtils.getTextAsQName(qnamePart));
                    if (process == null) {
                        throw new OdeFault("Could not find process: " + qnamePart.getTextAsQName());
                    }
                    String packageName = _store.getProcessConfiguration(OMUtils.getTextAsQName(qnamePart)).getPackage();
                    OMElement response = factory.createOMElement("packageName", null);
View Full Code Here

        _server = server;
    }

    public EndpointReference activateMyRoleEndpoint(QName processId, Endpoint myRoleEndpoint) {
        try {
            ProcessConf pconf = _server._store.getProcessConfiguration(processId);
            Definition wsdl = pconf.getDefinitionForService(myRoleEndpoint.serviceName);
            if (wsdl == null)
                throw new ContextException("Unable to access WSDL definition to activate MyRole endpoint for service " + myRoleEndpoint.serviceName
                        + " and port " + myRoleEndpoint.portName);
            ODEService svc = createService(pconf, myRoleEndpoint.serviceName, myRoleEndpoint.portName);
            EndpointReference epr = svc.getMyServiceRef();
View Full Code Here

    public PartnerRoleChannel createPartnerRoleChannel(QName processId, PortType portType,
                                                       Endpoint initialPartnerEndpoint) {
        // NOTE: This implementation assumes that the initial value of the
        // partner role determines the binding.
        ProcessConf pconf = _server._store.getProcessConfiguration(processId);
        Definition wsdl = pconf.getDefinitionForService(initialPartnerEndpoint.serviceName);
        if (wsdl == null) {
            throw new ContextException("Cannot find definition for service " + initialPartnerEndpoint.serviceName
                                       + " in the context of process "+processId);
        }
        return createExternalService(pconf, initialPartnerEndpoint.serviceName, initialPartnerEndpoint.portName);
View Full Code Here

    private void handleEvent(ProcessStoreEvent pse) {
        if (__log.isDebugEnabled()) {
            __log.debug("Process store event: " + pse);
        }
        ProcessConf pconf = _store.getProcessConfiguration(pse.pid);
        switch (pse.type) {
            case DEPLOYED:
                if (pconf != null) {
                    /*
                     * If and only if an old process exists with the same pid, the old process is cleaned up.
View Full Code Here

        OdeService service=_activeOdeServices.get(endpoint);
        if(service == null)
            service = new OdeService(this, endpoint);
        try {
            ProcessConf pc = _store.getProcessConfiguration(pid);
            InputStream is = pc.getCBPInputStream();
            OProcess compiledProcess = null;
            try {
                Serializer ofh = new Serializer(is);
                compiledProcess = ofh.readOProcess();
            } finally {
                is.close();
            }
            QName portType = null;
            for (Map.Entry<String, Endpoint> provide : pc.getProvideEndpoints().entrySet()) {
                if (provide.getValue().equals(endpoint)) {
                    OPartnerLink plink = compiledProcess.getPartnerLink(provide.getKey());
                    portType = plink.myRolePortType.getQName();
                    break;
                }
            }
            if (portType == null) {
                if (__log.isDebugEnabled()) {
                    __log.debug("Could not find PortType for endpoint");
                }
            } else {
                Definition def = pc.getDefinitionForService(endpoint.serviceName);
                if (def == null) {
                    __log.debug("Could not find definition for service: " + endpoint.serviceName);
                } else {
                    def = new WSDLFlattener(def).getDefinition(portType);
                    Document doc = WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
View Full Code Here

    public void testGetProcess() {
        Collection<QName> deployed = _ps.deploy(_testdd);
        QName pname = deployed.iterator().next();
        assertNotNull(deployed);
        assertEquals(1,deployed.size());
        ProcessConf pconf = _ps.getProcessConfiguration(pname);
        assertNotNull(pconf);
        assertEquals(_testdd.getName(),pconf.getPackage());
        assertEquals(pname, pconf.getProcessId());
    }
View Full Code Here

    public void testCleanupConfigurations() {
        Collection<QName> deployed = _ps.deploy(_testdd);
        QName pname = deployed.iterator().next();
        assertNotNull(deployed);
        assertEquals(1,deployed.size());
        ProcessConf pconf = _ps.getProcessConfiguration(pname);
        assertNotNull(pconf);
        assertEquals(_testdd.getName(),pconf.getPackage());
        assertEquals(pname, pconf.getProcessId());

        assertEquals(EnumSet.allOf(CLEANUP_CATEGORY.class), pconf.getCleanupCategories(true));
        assertEquals(EnumSet.of(CLEANUP_CATEGORY.MESSAGES, CLEANUP_CATEGORY.EVENTS), pconf.getCleanupCategories(false));

        assertTrue(pconf.isCleanupCategoryEnabled(true, CLEANUP_CATEGORY.INSTANCE));
        assertTrue(pconf.isCleanupCategoryEnabled(true, CLEANUP_CATEGORY.VARIABLES));
        assertTrue(pconf.isCleanupCategoryEnabled(true, CLEANUP_CATEGORY.MESSAGES));
        assertTrue(pconf.isCleanupCategoryEnabled(true, CLEANUP_CATEGORY.CORRELATIONS));
        assertTrue(pconf.isCleanupCategoryEnabled(true, CLEANUP_CATEGORY.EVENTS));
        assertFalse(pconf.isCleanupCategoryEnabled(false, CLEANUP_CATEGORY.INSTANCE));
        assertFalse(pconf.isCleanupCategoryEnabled(false, CLEANUP_CATEGORY.VARIABLES));
        assertTrue(pconf.isCleanupCategoryEnabled(false, CLEANUP_CATEGORY.MESSAGES));
        assertFalse(pconf.isCleanupCategoryEnabled(false, CLEANUP_CATEGORY.CORRELATIONS));
        assertTrue(pconf.isCleanupCategoryEnabled(false, CLEANUP_CATEGORY.EVENTS));

        assertEquals(2, pconf.getCronJobs().size());
        assertNotNull(pconf.getCronJobs().get(0).getCronExpression());
        assertEquals(3, pconf.getCronJobs().get(0).getRunnableDetailList().size());
    }
View Full Code Here

            }

            // We have to do this after we set the property, since the
            // ProcessConf object
            // is immutable.
            ProcessConf proc = _store.getProcessConfiguration(pid);
            if (proc == null)
                throw new ProcessNotFoundException("ProcessNotFound:" + pid);

            fillProcessInfo(pi, proc, new ProcessInfoCustomizer(ProcessInfoCustomizer.Item.PROPERTIES));
View Full Code Here

                __log.debug("Error setting property value for " + pid + "; " + propertyName, ex);
            }

            // We have to do this after we set the property, since the
            // ProcessConf object is immutable.
            ProcessConf proc = _store.getProcessConfiguration(pid);
            if (proc == null)
                throw new ProcessNotFoundException("ProcessNotFound:" + pid);

            fillProcessInfo(pi, proc, new ProcessInfoCustomizer(ProcessInfoCustomizer.Item.PROPERTIES));
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.iapi.ProcessConf

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.