clara

http://www.clara-rules.org/
sekao 2020-07-16T21:16:40.217200Z

is there any way, either with the public API or with private stuff, that i can determine which fact(s) caused a rule to fire? something that i could check in the right hand side of a rule. i tried looking in clara.rules.engine/**rule-context** but the :token inside it seems to contain all matching facts, not just the ones that triggered the rule.

2020-07-16T23:13:16.217900Z

@sekao if you use a fact level binding you have the fact available as a binding on rhs

2020-07-16T23:14:02.218800Z

[?fact <- Something] =>

sekao 2020-07-16T23:44:25.221600Z

yes but what i'm hoping to figure out is which of the bound facts actually caused the rule to fire. so if i have three facts bound on the lhs, in the rhs i want to know which of the three caused the current execution. i'm guessing this info is not available anywhere?

sekao 2020-07-16T23:46:20.223400Z

during the first execution the answer will be "all three caused it to fire", but if i insert a new fact that matches the first binding, for example, the rule will execute a second time, and i want to know that the first binding was what caused that second execution.