RulesEngine icon indicating copy to clipboard operation
RulesEngine copied to clipboard

On first condition met it shouldn't check other conditions

Open manjits1991 opened this issue 2 years ago • 1 comments

First of all I apologies for my bad English.

We have following rule and in this when input1 is coming null we are getting following exception. But as we are checking input1 == null then it shouldn't check the conditions after that as it's returning true from there only.

Exception: Exception while parsing expression input1 == null OR (input1 != null AND input1.legals != null AND input1.legals.Count() > 0) - No applicable method 'Count' exists in type 'Object'

Rule: { "RuleName": "LegalsNull", "SuccessEvent": "Legals are OK.", "ErrorMessage": "Legals should not be null.", "ErrorType": "Error", "RuleExpressionType": "LambdaExpression", "Expression": "input1 == null OR (input1 != null AND input1.legals != null AND input1.legals.Count() > 0)" }

I am already using var reSettings = new ReSettings { NestedRuleExecutionMode = NestedRuleExecutionMode.Performance }; here.

manjits1991 avatar Feb 21 '23 22:02 manjits1991

@manjits1991 this is more of a compilation issue rather than parsing. Would need more details on type of input that you pass

abbasc52 avatar Jan 13 '24 09:01 abbasc52