Package org.apache.ode.bpel.common

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


        if (__log.isDebugEnabled()) {
            __log.debug("dequeueEarliest: MATCHING correlationKey=" + instanceKeySet);
        }
        for (Iterator<MsgQueueEntry> i = _messages.iterator(); i.hasNext();) {
            MsgQueueEntry mqe = i.next();
            CorrelationKeySet aKeySet = mqe.keySet;
            if (aKeySet.isRoutableTo(instanceKeySet, false)) {
                i.remove();
                return mqe.message;
            }
        }
        if (__log.isDebugEnabled()) {
View Full Code Here


        public CorrelationKey getCorrelationKey() {
            return keySet.iterator().next();
        }

        public void setCorrelationKey(CorrelationKey ckey) {
            keySet = new CorrelationKeySet();
            keySet.add(ckey);
        }
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();
        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);
            keySet.add(key);
        }

        csets = _plinkDef.getJoinningCorrelationSetsForOperation(operation);
        for (OScope.CorrelationSet cset : csets) {
            CorrelationKey key = computeCorrelationKey(cset,
                    _process.getOProcess().messageTypes.get(msgDescription.getQName()), msg);
            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

                  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

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

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

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

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

    public void setCorrelatorId(String correlatorId) {
        _jobDetail.put("correlatorId", correlatorId);
    }
   
    public CorrelationKeySet getCorrelationKeySet() {
        return new CorrelationKeySet((String) _jobDetail.get("ckeySet"));
    }
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.