rulebook icon indicating copy to clipboard operation
rulebook copied to clipboard

Set Default RuleChainActionType to ERROR_ON_FAILURE

Open do0ominik opened this issue 5 years ago • 5 comments

It would be nice, if I could change the default RuleChainActionType to "ERROR_ON_FAILURE". Sometimes it happens that I forget to set the RuleChainActionType explizit on the @Rule-Annotation.

do0ominik avatar Mar 14 '19 09:03 do0ominik

This has gone back and forth a bit. Initially, there was no ERROR_ON_FAILURE - a rule failure was treated like an unevaluated rule. That seemed to be the preference for most. However, then a few people said they wanted an option to treat errors in rules differently than unevaluated rules. So, ERROR_ON_FAILURE was introduced. Since it seems like the common case for many is to treat errors in rules as rules that cannot be evaluated instead of breaking the rule chain on error, I think that's a good default behavior. But if you have a suggestion as to how ERROR_ON_FAILURE functionality could be better specified...

Clayton7510 avatar Apr 28 '19 05:04 Clayton7510

Thanks for your reply. I would suggest to provide a method like "setDefaultRuleChainActionType(...)". Currently we did a pre-compile step in order to force a build fail on missing rulechainactiontype specification. We had a few problems because there was an exception in one of our rules and nobody has noticed because the rule was "ignored/skipped". We are fine now but I think it would be nice to get a bit more flexible here.

do0ominik avatar Apr 29 '19 06:04 do0ominik

So, when you setup the RuleBookRunner, you can also specify a default rule chain action? I like it. I should be able to get that in within the next couple of weeks.

Clayton7510 avatar Apr 30 '19 11:04 Clayton7510

Thank you! That would be great.

do0ominik avatar Apr 30 '19 11:04 do0ominik

Should be up this week. Gotta do a release on another project tonight/tomorrow and then this is updated next.

Clayton7510 avatar May 15 '19 03:05 Clayton7510