assertNotNull( retractedWorker );
StatefulKnowledgeSessionImpl sessionImpl = (StatefulKnowledgeSessionImpl) ksession;
ReteooWorkingMemoryInterface reteWorkingMemory = sessionImpl.session;
AbstractWorkingMemory abstractWorkingMemory = (AbstractWorkingMemory) reteWorkingMemory;
InternalRuleBase ruleBase = (InternalRuleBase) abstractWorkingMemory.getRuleBase();
Collection<EntryPointNode> entryPointNodes = ruleBase.getRete().getEntryPointNodes().values();
EntryPointNode defaultEntryPointNode = null;
for ( EntryPointNode epNode : entryPointNodes ) {
if ( epNode.getEntryPoint().getEntryPointId() == "DEFAULT" ) {
defaultEntryPointNode = epNode;
break;
}
}
assertNotNull( defaultEntryPointNode );
Map<ObjectType, ObjectTypeNode> obnodes = defaultEntryPointNode.getObjectTypeNodes();
ObjectType key = new ClassObjectType( DroolsQuery.class );
ObjectTypeNode droolsQueryNode = obnodes.get( key );
ObjectHashSet droolsQueryMemory = ((ObjectTypeNodeMemory) abstractWorkingMemory.getNodeMemory( droolsQueryNode )).memory;
assertEquals( 0,
droolsQueryMemory.size() );
Entry[] entries = droolsQueryMemory.getTable();
int entryCounter = 0;