Fork me on GitHub

Generational data is kind of tricky. I think you could do what you want though (assuming im understanding) if, externally, you have some way to track "newest", having some sort of version field (whether this is datetime or incremented or whatever). Then, in the rules network, have an accumulator for the "newest" value of that field, and insert ->NewestFact and then depend on that instead. Logical retractions should take care of the rest. @dadair


i just realized you probably meant internal insertions not external.


if its internal (so inserting on the rhs), thats trickier because in my experience execution order dependent rules get you in trouble real quick, and without that i'm not sure how you would know what fact is "newer". If your goal is actually whatever fact has the most fields populated, you could still do a check on that in the accumulator, or probably better with rules with checks on the fields you care about.