Package org.apache.ode.bpel.dao

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


        QName processId;

        try {
            processId = _db.exec(new BpelDatabase.Callable<QName>() {
                public QName run(BpelDAOConnection conn) throws Exception {
                    ProcessInstanceDAO instance = conn.getInstance(iid);
                    return instance == null ? null : instance.getProcess().getProcessId();
                }
            });
        } catch (Exception e) {
            __log.error("Exception during instance retrieval", e);
            throw new ProcessingException("Exception during instance retrieval: " + e.toString());
View Full Code Here


        final TInstanceInfo ii = ret.addNewInstanceInfo();

        ii.setIid(iid.toString());
        dbexec(new BpelDatabase.Callable<Object>() {
            public Object run(BpelDAOConnection conn) throws Exception {
                ProcessInstanceDAO instance = conn.getInstance(iid);

                if (instance == null)
                    throw new InstanceNotFoundException("" + iid);
                // TODO: deal with "ERROR" state information.
                fillInstanceInfo(ii, instance);
View Full Code Here

    // 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

    void createStuff(BPELDAOConnectionFactoryImpl factory) throws Exception {
        BpelDAOConnection conn = factory.getConnection();

        CorrelatorDAO corr = createProcess(conn,"testPID1","testType");
    ProcessInstanceDAO pi1 = createProcessInstance(_process, corr);
    }
View Full Code Here

    _process.addCorrelator(CORRELATOR_ID2);
    return corr;
  }
 
  private ProcessInstanceDAO createProcessInstance(ProcessDAO process, CorrelatorDAO corr) throws SAXException, IOException {
    ProcessInstanceDAO pi = null;
    String[] actions = { "action1","action2" };
    String[] correlationKeys = { "key1", "key2" };
    CorrelationKey key1 = new CorrelationKey(1,correlationKeys);
    CorrelationKey key2 = new CorrelationKey(2,correlationKeys);
    CorrelationKey[] corrkeys = {key1,key2};
    QName[] names = { new QName(TEST_NS,"name1"), new QName(TEST_NS,"name2") };

        pi = process.createInstance(corr);
   
    pi.setExecutionState(new String("test execution state").getBytes());
    pi.setFault(new QName(TEST_NS,"testFault"), "testExplanation", 1, 1, DOMUtils.stringToDOM("<testFaultMessage>testMessage</testFaultMessage>"));
    pi.setLastActiveTime(cal.getTime());
    pi.setState((short) 1);
   
    pi.createActivityRecovery("testChannel1", 3, "testReason1", cal.getTime(), DOMUtils.stringToDOM("<testData>testData1</testData>"), actions, 2);
    pi.createActivityRecovery("testChannel2", 4, "testReason2", cal.getTime(), DOMUtils.stringToDOM("<testData>testData2</testData>"), actions, 2);
   
    ScopeDAO root = pi.createScope(null, "Root", 1);
    root.setState(ScopeStateEnum.ACTIVE);
    ScopeDAO child1 = pi.createScope(root, "Child1", 2);
    child1.setState(ScopeStateEnum.ACTIVE);
    XmlDataDAO var1 = child1.getVariable("var1");
    var1.set(DOMUtils.stringToDOM("<testData>testData</testData>"));
    var1.setProperty("key1", "prop1");
    var1.setProperty("key2", "prop2");
View Full Code Here

    public void instanceCompleted(ProcessInstanceDAO instance) {
        // Cleaning up
        if (__log.isDebugEnabled())
          __log.debug("Removing completed process instance " + instance.getInstanceId() + " from in-memory store.");
        _instancesAge.remove(instance.getInstanceId());
        ProcessInstanceDAO removed = _instances.remove(instance.getInstanceId());
        if (removed == null) {
            // Checking for leftover instances that should be removed
            ArrayList<Long> removals = new ArrayList<Long>(_instancesToRemove);
            for (Long iid : removals) {
                _instances.remove(iid);
View Full Code Here

            if (__log.isDebugEnabled()) {
                __log.debug("INPUTMSG: " + correlatorId + ": ROUTING to instance "
                        + messageRoute.getTargetInstance().getInstanceId());
            }

            ProcessInstanceDAO instanceDAO = messageRoute.getTargetInstance();
            ProcessDAO processDAO = instanceDAO.getProcess();
            enforceUniqueConstraint(processDAO, uniqueKeys);

            // Reload process instance for DAO.

            // Kill the route so some new message does not get routed to
            // same process instance.
            correlator.removeRoutes(messageRoute.getGroupId(), instanceDAO);

            // send process instance event
            CorrelationMatchEvent evt = new CorrelationMatchEvent(_process.getProcessModel().getQName(),
                    _process.getProcessDAO().getProcessId(), instanceDAO.getInstanceId(), matchedKey);
            evt.setPortType(mex.getPortType());
            evt.setOperation(operation.getName());
            evt.setMexId(mex.getMessageExchangeId());

            _process._debugger.onEvent(evt);
View Full Code Here

        // return;
        // }

        enforceUniqueConstraint(processDAO, uniqueKeys);
       
        ProcessInstanceDAO newInstance = processDAO.createInstance(correlator);
       
        // send process instance event
        NewProcessInstanceEvent evt = new NewProcessInstanceEvent(_process.getProcessModel().getQName(),
                processDAO.getProcessId(), newInstance.getInstanceId());
        evt.setPortType(mex.getPortType());
        evt.setOperation(operation.getName());
        evt.setMexId(mex.getMessageExchangeId());
        _process._debugger.onEvent(evt);
        _process.saveEvent(evt, newInstance);
View Full Code Here

        }
    }

    void executeContinueInstancePartnerRoleResponseReceived(MessageExchangeDAO mexdao) {
        assert _hydrationLatch.isLatched(1);
        ProcessInstanceDAO instanceDao = mexdao.getInstance();
        if (instanceDao == null)
            throw new BpelEngineException("InternalError: No instance for partner mex " + mexdao);

        BpelInstanceWorker worker = _instanceWorkerCache.get(mexdao.getInstance().getInstanceId());
        assert worker.isWorkerThread();
View Full Code Here

    private void execInstanceEvent(WorkEvent we) {
        BpelInstanceWorker worker = _instanceWorkerCache.get(we.getIID());
        assert worker.isWorkerThread();

        ProcessInstanceDAO instanceDAO = getProcessDAO().getInstance(we.getIID());
        MessageExchangeDAO mexDao = we.getMexId() == null ? null : loadMexDao(we.getMexId());

        if (instanceDAO == null) {
            if (__log.isDebugEnabled()) {
                __log.debug("handleWorkEvent: no ProcessInstance found with iid " + we.getIID() + "; ignoring.");
View Full Code Here

TOP

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

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.