Fork me on GitHub
#clara
<
2018-01-05
>
mikerod14:01:33

@dave.dixon I think that works. The only caveat is just that there are a few outstanding issues with RHS retract!. There are some edge cases with how they may work with logical insertions. I think it doesn’t typically come up. https://github.com/cerner/clara-rules/issues/229 https://github.com/cerner/clara-rules/issues/321 I mention both in http://www.metasimple.org/2017/12/23/clara-updating-facts.html

mikerod15:01:24

Other than that though, the rules above seem reasonable. That is something I’d expect should work. To the point @zylox made: It looks like you do have some sort of external retract that is removing the ActiveArticle in your example.

zylox15:01:48

Ya, i was approaching it from the perspective of using truth maintenance for it because of the "outside of a rule RHS?". glad you found something that works for you.

dave.dixon15:01:25

Yes, ActiveArticle is removed externally. It does work nicely.

dave.dixon15:01:31

::handle-cancelled-response is arguably just "nice to have", catches the case of ActiveArticle changing before the response to the comments request is received. If one ran into the edge-cases around retract! I think you could just have some sort of periodic clean-up of dangling CommentsResponse facts.

mikerod15:01:24

I like it overall. I really would like to try to get the edge cases of retract! removed. The issue it has is mostly how it interacts with the truth maintenance of other rules that are firing in the same “cycle”

mikerod15:01:19

The removal of the CommentsResponse cleans up all the Comment due to truth maintenance, which is nice.

mikerod15:01:43

Oh, I guess the ActiveArticle does too - woops. But either way, it is nice to be able to cleanup old facts liek that