You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When JSON fact is used, and when has some condition on a field which is missing in JSON, rule should consider that condition unmatched instead of erroring out entire execution.
If my condition is Event.Username == "john" || Event.Surname == "doe", if Event does not have Username field the execution fails with error like
got left hand expression error. got left hand expression error. got json field 'Username' is undefined" lib=grule-rule-engine package=ast
Instead here, it should consider Event.Username == "john" as false and evaluate Event.Surname == "doe" and match if it is true.
To Reproduce
Steps to reproduce the behavior:
I create code for this and that
rule Rule_90 "MatchingEquals1" salience 1 {
when
Event.Username == "john" || Event.Surname == "doe"
then
Output.Matched(Event.Surname, Event.Surname);
Retract("Rule_90");
Complete();
}
I see that Error while evaluating rule Rule_90, got left hand expression error. got left hand expression error. got json field 'Username' is undefined" lib=grule-rule-engine package=ast time="2024-01-04T13:46:04+05:30
Expected behavior
Rule should match as next OR expression matches without error.
Additional context
It also fails if we are using missing field in then as well.
The text was updated successfully, but these errors were encountered:
Describe the bug
When JSON fact is used, and
when
has some condition on a field which is missing in JSON, rule should consider that condition unmatched instead of erroring out entire execution.If my condition is
Event.Username == "john" || Event.Surname == "doe"
, if Event does not have Username field the execution fails with error likegot left hand expression error. got left hand expression error. got json field 'Username' is undefined" lib=grule-rule-engine package=ast
Instead here, it should consider
Event.Username == "john"
as false and evaluateEvent.Surname == "doe"
and match if it is true.To Reproduce
Steps to reproduce the behavior:
Instead of seeng this
Matching the rule
I see that
Error while evaluating rule Rule_90, got left hand expression error. got left hand expression error. got json field 'Username' is undefined" lib=grule-rule-engine package=ast time="2024-01-04T13:46:04+05:30
Expected behavior
Rule should match as next OR expression matches without error.
Additional context
It also fails if we are using missing field in then as well.
The text was updated successfully, but these errors were encountered: