public void rowAdded(final Rule rule,
final LeftTuple tuple,
final PropagationContext context,
final InternalWorkingMemory workingMemory) {
InternalFactHandle[] handles = new InternalFactHandle[tuple.getIndex() + 1];
LeftTuple entry = tuple;
// Add all the FactHandles
while ( entry != null) {
InternalFactHandle handle = entry.getLastHandle();
if ( handle != null ) {
// can be null for eval, not and exists that have no right input
handles[entry.getIndex()] = new DefaultFactHandle( handle.getId(),
( handle.getEntryPoint() != null ) ? handle.getEntryPoint().getEntryPointId() : null,
handle.getIdentityHashCode(),
handle.getObjectHashCode(),
handle.getRecency(),
handle.getObject() );
}
entry = entry.getParent();
}
QueryTerminalNode node = ( QueryTerminalNode ) tuple.getLeftTupleSink();
this.results.add( new QueryRowWithSubruleIndex(handles, node.getSubruleIndex()) );