Package org.apache.ode.bpel.dao

Examples of org.apache.ode.bpel.dao.ProcessDAO


                    ProcessInstanceStateChangeEvent evt = new ProcessInstanceStateChangeEvent();
                    evt.setOldState(instance.getState());
                    instance.setState(ProcessState.STATE_TERMINATED);
                    evt.setNewState(ProcessState.STATE_TERMINATED);
                    evt.setProcessInstanceId(iid);
                    ProcessDAO process = instance.getProcess();
                    QName processName = process.getType();
                    evt.setProcessName(processName);
                    QName processId = process.getProcessId();
                    evt.setProcessId(processId);
                    _process.saveEvent(evt, instance);
                    //
                    // TerminationEvent (peer of ProcessCompletionEvent)
                    //
View Full Code Here


        MessageExchangeDAO mexdao = _contexts.inMemDao.getConnection().getMessageExchange(mexId);
        if (mexdao == null) mexdao = _contexts.dao.getConnection().getMessageExchange(mexId);
        if (mexdao == null)
            return null;

        ProcessDAO pdao = mexdao.getProcess();
        BpelProcess process = pdao == null ? null : _activeProcesses.get(pdao.getProcessId());

        MessageExchangeImpl mex;
        switch (mexdao.getDirection()) {
        case MessageExchangeDAO.DIR_BPEL_INVOKES_PARTNERROLE:
            if (process == null) {
                String errmsg = __msgs.msgProcessNotActive(pdao.getProcessId());
                __log.error(errmsg);
                // TODO: Perhaps we should define a checked exception for this
                // condition.
                throw new BpelEngineException(errmsg);
            }
View Full Code Here

                    __log.debug(__msgs.msgScheduledJobReferencesUnknownInstance(we.getInstanceId()));
                    // nothing we can do, this instance is not in the database, it will always fail, not
                    // exactly an error since can occur in normal course of events.
                    return;
                }
                ProcessDAO processDao = instance.getProcess();
                process = _activeProcesses.get(processDao.getProcessId());
            }

            if (process == null) {
                // The process is not active, there's nothing we can do with this job
                if (__log.isDebugEnabled()) {
View Full Code Here

        ProcessDAOImpl p = (ProcessDAOImpl) l.get(0);
        return p;
    }

    public int getNumInstances(QName processId) {
        ProcessDAO process = getProcess(processId);
        if (process != null)
            return process.getNumInstances();
        else return -1;
    }
View Full Code Here

    }

    protected void go(String bundleName, int instances, int activityRecoveries, int correlationSets, int faults, int exchanges, int routes, int messsages, int partnerLinks, int scopes, int variables, int events, int largeData) throws Exception {
        if (server.isDeployed(bundleName)) server.undeployProcess(bundleName);
        server.deployProcess(bundleName);
        ProcessDAO process = null;
        try {
            initialLargeDataCount = getLargeDataCount(0);

            sendRequestFile("http://localhost:8888/processes/FirstProcess/FirstProcess/FirstProcess/Client", bundleName, "testRequest.soap");
            process = assertInstanceCleanup(instances, activityRecoveries, correlationSets, faults, exchanges, routes, messsages, partnerLinks, scopes, variables, events, largeData);
View Full Code Here

        _txm.begin();

        BpelDAOConnection conn = factory.getConnection();

        // Assert the ProcessDAO
        ProcessDAO p = conn.getProcess(new QName(TEST_NS,"testPID1"));
        assertNotNull( p );
        Collection<ProcessInstanceDAO> insts = p.findInstance(key1);
        assertNotNull( insts );
        assertTrue( insts.size() > 0 );
        assertNotNull(p.getType());
        assertNotNull(p.getProcessId());
        assertEquals( p.getVersion() , 1 );

        // Assert the CorrelatorDAO
        CorrelatorDAO corr = p.getCorrelator(CORRELATOR_ID1);
        assertNotNull( corr );
        assertEquals(corr.getCorrelatorId(),CORRELATOR_ID1);

        // Assert the MessageRouteDAO
        List<MessageRouteDAO> routes = corr.findRoute(new CorrelationKeySet().add(key1));
        MessageRouteDAO route = null;
        if (routes != null && routes.size() > 0) {
            route = routes.get(0);
        }
        assertNotNull( route );
        assertEquals(route.getGroupId(),"testRoute" );
        assertEquals(route.getIndex() , 1 );
        assertNotNull(route.getTargetInstance() );

        // Assert the ProcessInstanceDAO
        for ( ProcessInstanceDAO inst : insts ) {
            Long id = inst.getInstanceId();
            assertNotNull( id );

            ProcessInstanceDAO inst2 = conn.getInstance(id);
            assertSame(inst2,inst);

            ProcessInstanceDAO inst3 = p.getInstance(id);
            assertSame( inst3 , inst );

            Long mon = inst.genMonotonic();
            assertEquals(inst.getActivityFailureCount() , 2);
            assertNotNull(inst.getActivityFailureDateTime() );
View Full Code Here

    public ProcessInstanceDAO getInstance(Long instanceId) {
        return _getInstance(_sm, getSession(), instanceId);
    }

    public int getNumInstances(QName processId) {
        ProcessDAO process = getProcess(processId);
        if (process != null)
            return process.getNumInstances();
        else return -1;
    }
View Full Code Here

    }

    protected void go(String bundleName, int instances, int activityRecoveries, int correlationSets, int faults, int exchanges, int routes, int messsages, int partnerLinks, int scopes, int variables, int events, int largeData) throws Exception {
        if (server.isDeployed(bundleName)) server.undeployProcess(bundleName);
        server.deployProcess(bundleName);
        ProcessDAO process = null;
        try {
            initialLargeDataCount = getLargeDataCount(0);

            sendRequestFile("http://localhost:8888/processes/FirstProcess/FirstProcess/FirstProcess/Client", bundleName, "testRequest.soap");
            // every second, clean up cron job kicks in
View Full Code Here

    }

    protected void go(String bundleName, int instances, int activityRecoveries, int correlationSets, int faults, int exchanges, int routes, int messsages, int partnerLinks, int scopes, int variables, int events, int largeData) throws Exception {
        if (server.isDeployed(bundleName)) server.undeployProcess(bundleName);
        server.deployProcess(bundleName);
        ProcessDAO process = null;
        try {
            initialLargeDataCount = getLargeDataCount(0);

            sendRequestFile("http://localhost:8888/processes/FirstProcess/FirstProcess/FirstProcess/Client", bundleName, "testRequest.soap");
            // every second, clean up cron job kicks in
View Full Code Here

        server.deployProcess(bundleName);
        try {
            initialLargeDataCount = getLargeDataCount(0);
            sendRequestFile("http://localhost:8888/processes/helloWorld", bundleName, "testRequest.soap");
        } finally {
            ProcessDAO process = getProcess();
            server.undeployProcess(bundleName);
            assertProcessCleanup(process);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.dao.ProcessDAO

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.