Examples of CorrelationKeySet


Examples of org.apache.ode.bpel.common.CorrelationKeySet

     * @param matchCorrelations the match type correlation
     * @return returns the resolved CorrelationKey
     * @throws FaultException thrown when the correlation is not initialized and createInstance flag is not set
     */
    private CorrelationKeySet resolveCorrelationKey(PartnerLinkInstance pLinkInstance, Set<OScope.CorrelationSet> matchCorrelations) throws FaultException {
        CorrelationKeySet keySet = new CorrelationKeySet(); // is empty for the case of the createInstance activity

        if (matchCorrelations.isEmpty() && !_opick.createInstanceFlag) {
            // Adding a route for opaque correlation. In this case,
            // correlation is on "out-of-band" session-id
            String sessionId = getBpelRuntimeContext().fetchMySessionId(pLinkInstance);
            keySet.add(new CorrelationKey("-1", new String[] { sessionId }));
        } else if (!matchCorrelations.isEmpty()) {
            for( OScope.CorrelationSet cset : matchCorrelations ) {
                CorrelationKey key = null;

                if(!getBpelRuntimeContext().isCorrelationInitialized(
                    _scopeFrame.resolve(cset))) {
                    if (!_opick.createInstanceFlag) {
                        throw new FaultException(_opick.getOwner().constants.qnCorrelationViolation,
                        "Correlation not initialized.");
                    }
                } else {
                    key = getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(cset));
                    assert key != null;
                }

                if( key != null ) {
                    keySet.add(key);
                }
            }
        }

        return keySet;
View Full Code Here

Examples of org.apache.ode.bpel.common.CorrelationKeySet

        }
        public void setCorrelatorId(String correlatorId) {
            this.correlatorId = correlatorId;
        }
        public CorrelationKeySet getCorrelationKeySet() {
            return new CorrelationKeySet(correlationKeySet);
        }
View Full Code Here

Examples of org.apache.ode.bpel.common.CorrelationKeySet

    void setCorrelationKeySet(CorrelationKeySet correlationKeySet) {
        _correlationKeys = correlationKeySet.toCanonicalString();
    }

    CorrelationKeySet getCorrelationKeySet() {
        return new CorrelationKeySet(_correlationKeys);
    }
View Full Code Here

Examples of org.apache.ode.bpel.common.CorrelationKeySet

    public String getRoute() {
        return _routePolicy;
    }

    public CorrelationKeySet getCorrelationKeySet() {
        return new CorrelationKeySet(_correlationKey);
    }
View Full Code Here

Examples of org.apache.ode.bpel.common.CorrelationKeySet

        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() );
            assertNotNull(inst.getCreateTime() );
            assertTrue(inst.getExecutionState().length > 0 );
            assertNotNull(inst.getLastActiveTime() );
            assertSame(inst.getProcess() , p );
            assertEquals(inst.getPreviousState() , 0);
            assertEquals(inst.getState() , 1);

            // Assert the Root ScopeDAO
            ScopeDAO rs = inst.getRootScope();
            assertNotNull( rs );
            assertNotNull(rs.getChildScopes());
            ScopeDAO child1 = null;
            for ( ScopeDAO childItr : rs.getChildScopes()){
                child1 = childItr;
                break;
            }
            assertNotNull(child1);
            assertNotNull(rs.getCorrelationSets());
            assertEquals(rs.getCorrelationSets().size() , 0 );
            assertEquals(rs.getModelId(),1);
            assertEquals(rs.getName(),"Root");
            assertTrue(rs.getParentScope() == null);
            assertNotNull(rs.getPartnerLinks());
            assertEquals(rs.getPartnerLinks().size() ,0);
            assertSame(rs.getProcessInstance(),inst);
            assertNotNull(rs.getScopeInstanceId());
            assertEquals(rs.getState(),ScopeStateEnum.ACTIVE);
            assertNotNull(rs.getVariables());
            assertEquals(rs.getVariables().size(),0);


            // Assert the ActivityRecoveryDAO
            assertNotNull(inst.getActivityRecoveries());
            ActivityRecoveryDAO rec1 = null;
            for (ActivityRecoveryDAO recItr : inst.getActivityRecoveries()) {
       if (recItr.getActivityId() == 3) {
         rec1 = recItr;break;
       }
      }
            assertNotNull(rec1);
            String tmpAct = rec1.getActions();
//      assertEquals(rec1.getActionsList(),actions);
            assertEquals(rec1.getActivityId(),3);
            assertEquals(rec1.getChannel(),"testChannel1");
            assertNotNull(rec1.getDateTime());
//      assertNotNull(rec1.getDetails());
            assertEquals(rec1.getReason(),"testReason1");
            assertEquals(rec1.getRetries(),2);

            // Assert the CorrelationSetDAO
            //assertNotNull(inst.getCorrelationSets());
            //CorrelationSetDAO cs1 = null;
            //for ( CorrelationSetDAO csItr : inst.getCorrelationSets() ) {
            //  cs1 = csItr;
            //  break;
            //}
            //assertNotNull(cs1);

            // Assert the FaultDAO
            FaultDAO fault = inst.getFault();
            assertNotNull(fault);
            assertEquals(fault.getActivityId(),1);
            assertNotNull(fault.getData());
            assertEquals(fault.getExplanation(),"testExplanation");
            assertEquals(fault.getLineNo(),1);
            assertEquals(fault.getName(),new QName(TEST_NS,"testFault"));

            // Assert MessageExchangeDAO
            CorrelatorDAO ic = inst.getInstantiatingCorrelator();
            assertNotNull(ic);
            assertEquals(ic.getCorrelatorId(),CORRELATOR_ID1);
            // The message is dequeued but not persisted
            MessageExchangeDAO me = ic.dequeueMessage(new CorrelationKeySet().add(key1));
            assertNotNull(me);
            assertEquals(me.getCallee(),new QName(TEST_NS,"testCallee"));
            assertEquals(me.getPropagateTransactionFlag(),false);
            assertEquals(me.getChannel(),"testChannel");
            assertEquals(me.getCorrelationId(),"testCorrelationId");
View Full Code Here

Examples of org.apache.ode.bpel.common.CorrelationKeySet

    public String getRoute() {
        return _selector.getRoute();
    }

    public CorrelationKeySet getCorrelationKeySet() {
        return new CorrelationKeySet(_selector.getCorrelationKey());
    }
View Full Code Here

Examples of org.apache.ode.bpel.common.CorrelationKeySet

        pl1.setPartnerEPR(DOMUtils.stringToDOM("<testEPR>testPartnerEPR</testEPR>"));
        pl1.setPartnerSessionId("TestPartnerSessionID");

        MessageExchangeDAO mex = createMessageExchange(process,pi,pl1);

        corr.addRoute("testRoute", pi, 1, new CorrelationKeySet().add(key1), "one");
        corr.enqueueMessage(mex, new CorrelationKeySet().add(corrkeys[0]).add(corrkeys[1]));

        return pi;
    }
View Full Code Here

Examples of org.apache.ode.bpel.common.CorrelationKeySet

    }

    public CorrelationKeySet getKeySet() {
        // backward-compatibility; add up keys
        if( _keys.size() > 0 && _keySet == null ) {
            _keySet = new CorrelationKeySet();
        }
        for (CorrelationKey aKey : _keys) {
            if (aKey != null && !_keySet.contains(aKey)) {
                _keySet.add(aKey);
            }
View Full Code Here

Examples of org.apache.ode.bpel.common.CorrelationKeySet

        // data structure supporting correlation correlationKey matching!
        String correlatorId = BpelProcess.genCorrelatorId(_plinkDef, operation.getName());

        CorrelatorDAO correlator = _process.getProcessDAO().getCorrelator(correlatorId);

        CorrelationKeySet keySet;

        // We need to compute the correlation keys (based on the operation
        // we can  infer which correlation keys to compute - this is merely a set
        // consisting of each correlationKey used in each correlation sets
        // that is ever referenced in an <receive>/<onMessage> on this
View Full Code Here

Examples of org.apache.ode.bpel.common.CorrelationKeySet

    private Operation getMyRoleOperation(String operationName) {
        return _plinkDef.getMyRoleOperation(operationName);
    }

    private CorrelationKeySet computeCorrelationKeys(MyRoleMessageExchangeImpl mex) {
        CorrelationKeySet keySet = new CorrelationKeySet();

        Operation operation = mex.getOperation();
        Element msg = mex.getRequest().getMessage();
        Map<String, Node> headerParts = mex.getRequest().getHeaderParts();
        javax.wsdl.Message msgDescription = operation.getInput().getMessage();

        Set<OScope.CorrelationSet> csets = _plinkDef.getNonInitiatingCorrelationSetsForOperation(operation);
        for (OScope.CorrelationSet cset : csets) {
            CorrelationKey key = computeCorrelationKey(cset,
                    _process.getOProcess().messageTypes.get(msgDescription.getQName()), msg, headerParts);
            keySet.add(key);
        }

        csets = _plinkDef.getJoinningCorrelationSetsForOperation(operation);
        for (OScope.CorrelationSet cset : csets) {
            CorrelationKey key = computeCorrelationKey(cset,
                    _process.getOProcess().messageTypes.get(msgDescription.getQName()), msg, headerParts);
            keySet.add(key);
        }

        // Let's creata a key based on the sessionId
        String mySessionId = mex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID);
        if (mySessionId != null)
            keySet.add(new CorrelationKey("-1", new String[] { mySessionId }));

        return keySet;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.