/** * 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; }
/** * 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 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; }