Search in sources :

Example 1 with ObjectStore

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;
}
Also used : CoreWrapper(org.drools.core.factmodel.traits.CoreWrapper) ObjectStore(org.drools.core.common.ObjectStore) WorkingMemoryEntryPoint(org.drools.core.WorkingMemoryEntryPoint) InternalWorkingMemoryEntryPoint(org.drools.core.common.InternalWorkingMemoryEntryPoint) NamedEntryPoint(org.drools.core.common.NamedEntryPoint) EntryPoint(org.kie.api.runtime.rule.EntryPoint) InternalFactHandle(org.drools.core.common.InternalFactHandle) WorkingMemoryEntryPoint(org.drools.core.WorkingMemoryEntryPoint) InternalWorkingMemoryEntryPoint(org.drools.core.common.InternalWorkingMemoryEntryPoint)

Aggregations

WorkingMemoryEntryPoint (org.drools.core.WorkingMemoryEntryPoint)1 InternalFactHandle (org.drools.core.common.InternalFactHandle)1 InternalWorkingMemoryEntryPoint (org.drools.core.common.InternalWorkingMemoryEntryPoint)1 NamedEntryPoint (org.drools.core.common.NamedEntryPoint)1 ObjectStore (org.drools.core.common.ObjectStore)1 CoreWrapper (org.drools.core.factmodel.traits.CoreWrapper)1 EntryPoint (org.kie.api.runtime.rule.EntryPoint)1