Package org.apache.ode.bpel.common

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


            propNames[i] = property.name.toString();
            if (__log.isDebugEnabled())
              __log.debug("Setting correlation property " + propNames[i] + "=" + propValues[i]);
        }

        CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.name, propValues);
        getBpelRuntimeContext().writeCorrelation(cset,ckeyVal);
    }


    public void setCorrelationKey(CorrelationKey key) {
         _selector.setCorrelationKey(key.toCanonicalString());
     }

     public CorrelationKey getCorrelationKey() {
         return new CorrelationKey(_selector.getCorrelationKey());
     }

        entering("CorrelatorDaoImpl.CorrelatorDaoImpl");
        _hobj = hobj;
    }

    public CorrelationKey getCorrelationKey() {
        return new CorrelationKey(_hobj.getCorrelationKey());
    }

        getSession().update(_correlationSet);
    }

  public CorrelationKey getValue() {
      entering("CorrelationSetDaoImpl.getValue");
    if (_correlationSet.getValue() != null) return new CorrelationKey(_correlationSet.getValue());
    else return null;
  }

    return _scope;
  }

  public CorrelationKey getValue() {
        if (_correlationKey == null) return null;
        return new CorrelationKey(_correlationKey);
  }

    public Long getId() {
        return _id;
    }

    public CorrelationKey getCorrelationKey() {
    return new CorrelationKey(_correlationKey);
  }

        HashMap<Long,ProcessInstanceDAO> instances = new HashMap<Long,ProcessInstanceDAO>();

        // Migrate correlation set values
        Collection<CorrelationSetDAO> csets = connection.getActiveCorrelationSets();
        for (CorrelationSetDAO cset : csets) {
            CorrelationKey ckey = cset.getValue();
            instances.put(cset.getInstance().getInstanceId(), cset.getInstance());
            if (ckey != null) {
                __log.debug("Correlation set id " + cset.getCorrelationSetId() + " key " + ckey);
                Integer ckeyInt = asInt(ckey.getCorrelationSetName());
                if (ckeyInt != null) {
                    OScope.CorrelationSet ocset = findCorrelationById(ckeyInt, registeredProcesses, cset.getProcess().getProcessId());
                    if (ocset == null) __log.debug("Correlation set not found, couldn't upgrade set " + ckey.toCanonicalString());
                    else {
                        cset.setValue(null, new CorrelationKey(ocset.name, ckey.getValues()));
                    }
                }
            }
        }

        // Migrate routes and message queue for each correlator
        for (BpelProcess process : registeredProcesses) {
            __log.debug("Migrating correlators for process " + process.getConf().getProcessId());
            ProcessDAO processDao = connection.getProcess(process.getConf().getProcessId());

            for (OPartnerLink plink : process.getOProcess().getAllPartnerLinks()) {
                if (plink.hasMyRole()) {
                    for (Iterator opI = plink.myRolePortType.getOperations().iterator(); opI.hasNext();) {
                        Operation op = (Operation)opI.next();
                        try {
                            CorrelatorDAO corr = processDao.getCorrelator(plink.getName() + "." + op.getName());
                            // Changing all routes
                            if (corr != null) {
                                for (MessageRouteDAO routeDAO : corr.getAllRoutes()) {
                                    CorrelationKey oldKey = routeDAO.getCorrelationKey();
                                    if (oldKey != null) {
                                        Integer ckeyInt = asInt(oldKey.getCorrelationSetName());
                                        if (ckeyInt != null) {
                                            OScope.CorrelationSet ocset = findCorrelationById(ckeyInt, registeredProcesses, process.getConf().getProcessId());
                                            if (ocset == null) __log.debug("Correlation set not found, couldn't upgrade route " + oldKey.toCanonicalString());
                                            else {
                                                routeDAO.setCorrelationKey(new CorrelationKey(ocset.name, oldKey.getValues()));
                                            }
                                        }
                                    }
                                }

                                // Changing all queued messages
                                for (CorrelatorMessageDAO corrMsgDAO : corr.getAllMessages()) {
                                    CorrelationKey oldKey = corrMsgDAO.getCorrelationKey();
                                    if (oldKey != null) {
                                        Integer ckeyInt = asInt(oldKey.getCorrelationSetName());
                                        if (ckeyInt != null) {
                                            OScope.CorrelationSet ocset = findCorrelationById(ckeyInt, registeredProcesses, process.getConf().getProcessId());
                                            if (ocset == null) __log.debug("Correlation set not found, couldn't upgrade route " + oldKey.toCanonicalString());
                                            else {
                                                corrMsgDAO.setCorrelationKey(new CorrelationKey(ocset.name, oldKey.getValues()));
                                            }
                                        }
                                    }
                                }
                            __log.debug("Migrated routes and message queue for correlator " + plink.getName() + "." + op.getName());

                        Operation op = (Operation)opI.next();
                        CorrelatorDAO corr = processDao.getCorrelator(plink.getName() + "." + op.getName());
                        // Changing all routes
                        if (corr != null) {
                            for (MessageRouteDAO routeDAO : corr.getAllRoutes()) {
                                CorrelationKey oldKey = routeDAO.getCorrelationKey();
                                if (oldKey != null) {
                                    CorrelationKeySet keySet = new CorrelationKeySet();
                                    keySet.add(oldKey);
                                    routeDAO.setCorrelationKeySet(keySet);
                                }

        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,

                    if (selCKey != null) {
                        OldCorrelationKey old = (OldCorrelationKey) selCKey;
                        __log.debug("   Changing V1 key " + old.toCanonicalString());

                        CorrelationKeySet newKeySet = new CorrelationKeySet();
                        newKeySet.add(new CorrelationKey(""+old.getCSetId(), old.getValues()));
                        Selector newSelector = new Selector(sel.idx, sel.plinkInstance, sel.opName,
                                sel.oneWay, sel.messageExchangeId, newKeySet, "one");
                        newSelector.correlationKey = new CorrelationKey(""+old.getCSetId(), old.getValues());
                        newSelectors[index++] = newSelector;
                    }
                }
                entry.selectors = newSelectors;
            }

TOP

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

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.