deliveredtechnologies / rulebook

100% Java, Lambda Enabled, Lightweight Rules Engine with a Simple and Intuitive DSL
http://www.deliveredtechnologies.com
Apache License 2.0
716 stars 124 forks source link

POJO RuleChain should stop if STOP_ON_FAILURE is set as ruleChainAction #166

Closed mikelear closed 5 years ago

mikelear commented 5 years ago

This should fix #159 , if an Exception is thrown we have a RuleStatus of EXCEPTION, we set this on the Exception handling. I think this is how the RuleChain should work but would appreciate any feedback

mikelear commented 5 years ago

Changed some logic to handle the new ERROR status and added some more tests

mikelear commented 5 years ago

Added a lot more tests to check for the execution of POJO rules. For instance if you set a BREAK in the then() but have set STOP_ON_FAILURE it won't stop, this is the current execution and I've left it like that but added a Test to show this (and quiet a few more POJO tests as there isn't as many as there are for RuleBuilder logic) This fix mainly STOPS/ERRORS (RuleException) correctly when there is an EXCEPTION in when ( as the #159 was originally opened for) and then adds the Tests to who that and other POJO scenarios.

Clayton7510 commented 5 years ago

Thanks for the contribution!

mikelear commented 5 years ago

my pleasure , thanks for checking