Fork me on GitHub
#clara
<
2017-07-29
>
zylox16:07:11

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

zylox16:07:27

i just realized you probably meant internal insertions not external.

zylox16:07:56

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.