use of org.drools.core.common.ObjectStore in project drools by kiegroup.
the class TraitHelper method lookupHandleForWrapper.
private <K> InternalFactHandle lookupHandleForWrapper(K core) {
for (EntryPoint ep : workingMemory.getEntryPoints()) {
ObjectStore store = ((WorkingMemoryEntryPoint) ep).getObjectStore();
Iterator<InternalFactHandle> iter = store.iterateFactHandles();
while (iter.hasNext()) {
InternalFactHandle handle = iter.next();
if (handle.isTraitable() && handle.getObject() instanceof CoreWrapper && ((CoreWrapper) handle.getObject()).getCore() == core) {
return handle;
}
}
}
return null;
}
Aggregations