BaseNode[] tnodes = ( BaseNode[] ) ruleBase.getReteooBuilder().getTerminalNodes(queryName);
if ( tnodes == null ) {
throw new RuntimeException( "Query '" + queryName + "' does not exist");
}
QueryTerminalNode tnode = ( QueryTerminalNode ) tnodes[0];
LeftTupleSource lts = tnode.getLeftTupleSource();
while ( lts.getType() != NodeTypeEnums.LeftInputAdapterNode ) {
lts = lts.getLeftTupleSource();
}
LeftInputAdapterNode lian = ( LeftInputAdapterNode ) lts;
LiaNodeMemory lmem = (LiaNodeMemory) getNodeMemory( (MemoryFactory) lts);