private static void addObjectSink(InternalRuleBase ruleBase,
ObjectSink sink,
Map<Integer, BaseNode> nodes) {
// we don't need to store alpha nodes, as they have no state to serialise
if ( sink instanceof LeftTupleSource ) {
LeftTupleSource node = (LeftTupleSource) sink;
for ( LeftTupleSink leftTupleSink : node.getSinkPropagator().getSinks() ) {
addLeftTupleSink( ruleBase,
leftTupleSink,
nodes );
}
} else {
ObjectSource node = ( ObjectSource ) sink;
for ( ObjectSink objectSink : node.getSinkPropagator().getSinks() ) {
addObjectSink( ruleBase,
objectSink,
nodes );
}
}