Package org.apache.ode.bpel.common

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


                        matchCorrelations.add(cset);
                    }
                }

                PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(onMessage.partnerLink);
                CorrelationKeySet keySet = resolveCorrelationKey(pLinkInstance, matchCorrelations);

                selectors[idx] = new Selector(idx, pLinkInstance, onMessage.operation.getName(), onMessage.operation
                        .getOutput() == null, onMessage.messageExchangeId, keySet, onMessage.route);
                idx++;
            }
View Full Code Here

     * @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

       
        SessionManager sm = ((BpelDAOConnectionImpl) daoConn)._sm;
        HCorrelator correlator = new HCorrelator();
        correlator.setCorrelatorId("abc");
        sm.getSession().save(correlator);
        new CorrelatorDaoImpl(sm, correlator).dequeueMessage(new CorrelationKeySet("@2[12~a~b]"));
    }
View Full Code Here

         */
        public void run() {
            Selector selector;
            try {
                PickResponseChannel pickResponseChannel = newChannel(PickResponseChannel.class);
                CorrelationKeySet keySet = new CorrelationKeySet();
                PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(_oevent.partnerLink);
                for( OScope.CorrelationSet cset : _oevent.joinCorrelations ) {
                    if(getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(cset))) {
                        keySet.add(getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(cset)));
                    }
                }
                for( OScope.CorrelationSet cset : _oevent.matchCorrelations ) {
                    if (!getBpelRuntimeContext().isCorrelationInitialized(_scopeFrame.resolve(cset))) {
                        throw new FaultException(_oevent.getOwner().constants.qnCorrelationViolation,"Correlation not initialized.");
                    }
                    keySet.add(getBpelRuntimeContext().readCorrelation(_scopeFrame.resolve(cset)));
                }
                if( keySet.isEmpty() ) {
                    // Adding a route for opaque correlation. In this case correlation is done on "out-of-band" session id.
                    String sessionId = getBpelRuntimeContext().fetchMySessionId(pLinkInstance);
                    keySet.add(new CorrelationKey("-1", new String[] {sessionId}));
                }

                selector =  new Selector(0,pLinkInstance,_oevent.operation.getName(), _oevent.operation.getOutput() == null, _oevent.messageExchangeId, keySet, _oevent.route);
                getBpelRuntimeContext().select(pickResponseChannel, null, false, new Selector[] { selector} );
                instance(new WAITING(pickResponseChannel));
View Full Code Here

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

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

    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();

        //TODO get filter from the system
        QName correlationFilter = _process.getCorrelationFilter(_plinkDef.getName());
        if (correlationFilter != null) {
            ExtensionCorrelationFilter extCorFilter =
                    createExtensionCorrelationFilterImplementation(correlationFilter);       

            if (extCorFilter != null) {
                CorrelationKey extensionKey = new CorrelationKey("-1",
                        extCorFilter.computeCorrelationValues(mex.getRequest().getMessage(),
                                                              mex.getRequest().getHeader()));
                keySet.add(extensionKey);
            }
        }

        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

        }

        ProcessDAO processDao = _dao.getProcess();
        CorrelatorDAO notificationCorrelator = processDao.getCorrelator(correlatorId);
        CorrelationKey notificationCorrelationKey = new CorrelationKey("-1", correlationValues);
        CorrelationKeySet correlationKeySet = new CorrelationKeySet();
        correlationKeySet.add(notificationCorrelationKey);
        notificationCorrelator.addRoute(notificationChannelId, _dao, 0, correlationKeySet, "one");
        scheduleCorrelatorMatcher(notificationCorrelator.getCorrelatorId(), correlationKeySet);
    }
View Full Code Here

                        matchCorrelations.add(cset);
                    }
                }

                PartnerLinkInstance pLinkInstance = _scopeFrame.resolve(onMessage.partnerLink);
                CorrelationKeySet keySet = resolveCorrelationKey(pLinkInstance, matchCorrelations);

                selectors[idx] = new Selector(idx, pLinkInstance, onMessage.operation.getName(), onMessage.operation
                        .getOutput() == null, onMessage.messageExchangeId, keySet, onMessage.route);
                idx++;
            }
View Full Code Here

TOP

Related Classes of org.apache.ode.bpel.common.CorrelationKeySet

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.