Hi team,
Consider a drl rule definition below
Github drl file definition
We are trying to use dynamic data types like Map<String,Object>.
Scenario 1:
m : HashMap( this["age"] > 14 && this["clicks"] + this["visits"] > 500 )
For a rule with conditions like the above, the second part this["clicks"] + this["visits"] > 500 throws an exception if any of the parameters are missing in the HashMap. When an exception is thrown in any of the rules in a kie session, the whole kie session gets terminated without any further execution or rule outcome.
Scenario 2:
m : HashMap( Double.parseDouble(this["visits"]) > 500 )
Here, if the visits param is null, then there will be an exception thrown from the rule and the whole kie session will be affected.
The way I want to handle this scenario is, any rule throwing the exception alone should fail and there must be a way to catch the exception and fail gracefully with additional logging. Other rules in the same kie session must continue the rule activation and execution without an abrupt halt.
If there is an exception listener like https://docs.drools.org/5.6.0.Final/knowledge-api-javadoc/index.html?org/drools/conf/ConsequenceExceptionHandlerOption.html
for the drools condition evaluation, it may be helpful.
Do we have any such feature? Or is there a way to achieve this expected behaviour via some drools configuration?
In case a sample project is required to test, please clone this simple app and try out the same.
Scenario one is available in Drools sample app
--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/bb8c66c7-5675-4d1c-b97b-3c867cb72a2an%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/bb8c66c7-5675-4d1c-b97b-3c867cb72a2an%40googlegroups.com.