public CorrelationKey getCorrelationKey() { return new CorrelationKey(_selector.getCorrelationKey()); }
public String toCanonicalString() { StringBuffer buf = new StringBuffer(); buf.append(_csetName); buf.append('~'); for (int i = 0; i < getValues().length; ++i) { if (i != 0) buf.append('~'); escapeTilde(buf, getValues()[i]); } return buf.toString(); }
public void setCorrelationKey(CorrelationKey ckey) { _hobj.setCorrelationKey(ckey.toCanonicalString()); } }
CorrelationKey selCKey = (CorrelationKey) sel.correlationKey; if (selCKey != null) { __log.debug(" Changing V2 key " + selCKey.toCanonicalString()); newKeySet.add(new CorrelationKey(""+selCKey.getCorrelationSetName(), selCKey.getValues())); Selector newSelector = new Selector(sel.idx, sel.plinkInstance, sel.opName, sel.oneWay, sel.messageExchangeId, newKeySet, "one"); newSelector.correlationKey = new CorrelationKey(""+selCKey.getCorrelationSetName(), selCKey.getValues()); newSelectors[index++] = newSelector;
public void setValue(QName[] names, CorrelationKey values) { entering("CorrelationSetDaoImpl.setValue"); _correlationSet.setValue(values.toCanonicalString()); if (names != null) { if (_correlationSet.getProperties() == null || _correlationSet.getProperties().size() == 0) { for (int m = 0; m < names.length; m++) { HCorrelationProperty prop = new HCorrelationProperty(names[m], values.getValues()[m], _correlationSet); getSession().save(prop); } } else { for (int m = 0; m < names.length; m++) { HCorrelationProperty prop = getProperty(names[m]); if (prop == null) prop = new HCorrelationProperty(names[m], values.getValues()[m], _correlationSet); else prop.setValue(values.getValues()[m]); getSession().save(prop); } } } getSession().update(_correlationSet); }
public void setValue(QName[] names, CorrelationKey values) { _key = values; if (names != null) { _corrValues = new HashMap<QName, String>(); for (int m = 0; m < names.length; m++) { _corrValues.put(names[m], values.getValues()[m]); } } }
public int compare(CorrelationKey o1, CorrelationKey o2) { if( o1 == null || o2 == null ) { return 0; } // used only in sorting the correlation keys in the CorrelationKeySet; does not matter with the values return o1.getCorrelationSetName().compareTo(o2.getCorrelationSetName()); } }
/** * Check if this key matches any member in a set of keys. * * @param keys * set of keys to match against * * @return <code>true</code> if one of the keys in the set * <code>equals(..)</code> this key, <code>false</code> * otherwise */ public boolean isMatch(CorrelationKey[] keys) { for (CorrelationKey key : keys) if (key.equals(this)) { return true; } return false; }
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())); 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())); 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()));
/** * Adds a correlation key to this correlation key set. If a correlation key with the same correlation set id * already exists, the old one is replaced with the given new one. * * @param ck a correlation key to add * @return returns this correlation key set */ public CorrelationKeySet add(CorrelationKey ck) { for( CorrelationKey key : correlationKeys ) { if( key.getCorrelationSetName().equals(ck.getCorrelationSetName()) ) { correlationKeys.remove(ck); break; } } correlationKeys.add(ck); return this; }
/** * Returns true if this correlation key set contains the give correlation key. * * @param correlationKey a correlation key * @return */ public boolean contains(CorrelationKey correlationKey) { Iterator<CorrelationKey> e = correlationKeys.iterator(); if (correlationKey == null) { while (e.hasNext()) if (e.next() == null) return true; } else { while (e.hasNext()) { if (correlationKey.equals(e.next())) return true; } } return false; }
public CorrelationKey getCorrelationKey() { return new CorrelationKey(_hobj.getCorrelationKey()); }
/** * Returns a canonical form of this correlation key set. * * @return */ public String toCanonicalString() { StringBuffer buf = new StringBuffer(); for( CorrelationKey ckey : correlationKeys ) { if( buf.length() > 0 ) { buf.append(","); } buf.append("[").append(escapeRightBracket(ckey.toCanonicalString())).append("]"); } return "@" + VERSION_2 + buf.toString(); }
/** * Checks if this correlation key set contains the opaque correlation key as the only key * in this correlation key set. * * @return returns true if the correlation key set is opaque */ public boolean isOpaque() { return correlationKeys.size() == 1 && correlationKeys.iterator().next().getCorrelationSetName().equals("-1"); }
public Collection<ProcessInstanceDAO> findInstance(CorrelationKey key) { ArrayList<ProcessInstanceDAO> result = new ArrayList<ProcessInstanceDAO>(); for (ProcessInstanceDAO instance : _instances.values()) { for (CorrelationSetDAO corrSet : instance.getCorrelationSets()) { if (corrSet.getValue().equals(key)) result.add(instance); } } return result; }
/** * Restores the state of this correlation key set from a canonical form. * * @param canonicalForm a canonical form of correlation key set */ public void restore(String canonicalForm) { if( canonicalForm == null || canonicalForm.trim().length() == 0 ) return; if( canonicalForm.startsWith("@") ) { parseCanonicalForm(canonicalForm); } else { version = VERSION_1; add( new CorrelationKey(canonicalForm) ); } }
public void setCorrelationKey(CorrelationKey key) { _selector.setCorrelationKey(key.toCanonicalString()); }
for( CorrelationKey ckey : correlationKeys ) { if( ckey.getCorrelationSetName().equals("-1") ) { opaqueKey = ckey; } else {
CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.name, propValues); writeCorrelation(cset, ckeyVal);
/** * @see org.apache.ode.bpel.dao.ProcessDAO#findInstance(CorrelationKey) */ @SuppressWarnings("unchecked") public Collection<ProcessInstanceDAO> findInstance(CorrelationKey ckeyValue) { entering("ProcessDaoImpl.findInstance"); Criteria criteria = getSession().createCriteria(HCorrelationSet.class); criteria.add(Expression.eq("scope.instance.process.id",_process.getId())); criteria.add(Expression.eq("value", ckeyValue.toCanonicalString())); criteria.addOrder(Order.desc("scope.instance.created")); return criteria.list(); }