Fork me on GitHub
#clara
<
2019-08-07
>
hadils14:08:25

Thanks @mikerod ! I am creating an empty session at this point. That seems to resolve these errors.

mikerod14:08:04

Hmm. Interesting. Well feel free to ask if you have more questions.

sparkofreason20:08:41

If the only thing that changes in the LHS of a rule is an accumulator value, is it correct that the rule won't fire if the collection of facts matching the accumulator condition change?

ethanc20:08:52

I would think that if an accumulator saw a new value, and the previously accumulated objects changed that there would be work that the rhs would have to do. Though I might be misunderstanding your question

sparkofreason20:08:54

That's how I want it to behave, but I have a distant recollection that it doesn't actually work that way. Been awhile since I've played with clara.

ProbablyJody20:08:29

@dave.dixon, are you thinking of the retract-fn’s behavior?

sparkofreason20:08:47

Could be. Possible I'm just writing my accumulation clause wrong or something, because sometimes it does seem to behave as you described.

mikerod21:08:57

@dave.dixon in current version of Clara (and several before) the rule will not continue to propagate if the accumulated value hasn’t changed according to = See lines like https://github.com/cerner/clara-rules/blob/master/src/main/clojure/clara/rules/engine.cljc#L1200

mikerod21:08:34

So specifically if the accumulators result from the :convert-return-fn is = to what it was in the previous round of accumulating fact matches, propagation stops - which would imply no RHS action being triggered/activated

mikerod21:08:58

The tests near what Jody pointed too could be enlightening on some more semantics though. I agree

mikerod21:08:21

There are quite detailed github issues out there that also discuss these semantics when we added the related changes.

sparkofreason21:08:20

@mikerod Thanks. Not exactly sure what I was thinking of. My actual problem was that I was hacking at something trying to make it update in place rather than letting truth maintenance do the lifting. Need to get back to "thinking TMS" 😉

mikerod21:08:06

Yes. No mutate in place. That’ll indeed cause issues.