str += "then \n";
str += "end \n";
KnowledgeBase kbase = loadKnowledgeBaseFromString( str );
ReteooWorkingMemoryInterface wm = ((StatefulKnowledgeSessionImpl)kbase.newStatefulKnowledgeSession()).session;
wm.fireAllRules();
ObjectTypeNode otnInit = getObjectTypeNode(kbase, "InitialFactImpl" );
LeftInputAdapterNode liaNode = ( LeftInputAdapterNode ) otnInit.getSinkPropagator().getSinks()[0];
LeftTupleSink[] sinks = liaNode.getSinkPropagator().getSinks();
assertEquals(0, sinks[0].getLeftInputOtnId().getId() );
assertEquals(1, sinks[1].getLeftInputOtnId().getId() );
assertEquals(2, sinks[2].getLeftInputOtnId().getId() );
assertEquals(3, sinks[3].getLeftInputOtnId().getId() );
ObjectTypeNode otnPerson = getObjectTypeNode(kbase, "Person" );
ObjectTypeNode otnCheese = getObjectTypeNode(kbase, "Cheese" );
assertEquals( 0, otnPerson.getOtnIdCounter() );
assertEquals( 0, otnCheese.getOtnIdCounter() );
wm.insert( new Person() );
wm.insert( new Cheese() );
assertEquals( 5, otnPerson.getOtnIdCounter() );
assertEquals( 4, otnCheese.getOtnIdCounter() );
}