clara

http://www.clara-rules.org/
futuro 2019-12-28T00:51:41.008200Z

I have three rules which have the same fact expressions in their LHS, and I’d like to extract them to aid in reuse.

futuro 2019-12-28T00:52:04.009100Z

I’m not at a computer, but I can write up a little snippet later if that’d make it clearer.

ethanc 2019-12-28T00:54:01.012100Z

I would usually use an intermediate fact in that scenario, one rule that inserts the fact constrained by the common lhs and then downstream rules can rely on the presence of the intermediate fact

👍 1
futuro 2019-12-28T00:57:24.014200Z

Hmmm, yeah, that could work. I suppose you’d put any shared fields you needed into this shared fact, which would allow downstream rules to pull them back out, yeah?

ethanc 2019-12-28T01:10:31.017400Z

Yes, they would carry what's needed. In some cases simply wrapping the whole fact might make sense

👍 1
futuro 2019-12-28T01:57:09.018100Z

Swanky, thank you @ethanc !

👍 3