Fork me on GitHub
#clara
<
2021-05-26
>
Linus Ericsson17:05:44

When I construct rules, I sometimes make circular references (often by a rule inserting a fact which invalidates itself which triggers a rule that inserts a fact again). Is there any way to tell clara-rules to actually cancel when it has ended up in a cycle like this?

ethanc17:05:41

I believe @wparker was working on something like this

wparker08:05:28

Yes this feature allow you to detect when Clara is likely in a loop and then define behaviour such as logging something, throwing an exception, etc. Do note that it is fundamentally an error handing construct though, not a way to actually stop the loop while still having a valid outcome of firing the rules (obviously throwing an exception etc. will stop the loop but you won’t have output from the rules session). @UQY3M3F6D

👍 3