nagarajgond commented on issue #6543:
URL:
https://github.com/apache/incubator-kie-drools/issues/6543#issuecomment-3642681752
Got it.
If you use an `or` condition where a variable (like $f) is only bound in
some branches (not all), Drools tries to resolve $f for the then block
regardless of which branch matched. If the `not` branch matches, $f is not
bound, leading to a NullPointerException during rule evaluation
So I have to avoid variables for my use case where I use `not` condition as
well.
Can I solve it like this, is there any performance impact with approach ?
Any other rule gets impacted by this fact?
```
rule "rule5_preprocess1"
salience -997
when
(/facts [ name == "address", value == "1.1.1.1" ])
or ( not /facts [ name == "location.city" ] )
or ( /facts [ name == "address", value == "1.1.1.2"])
then
DroolsFact fact = new DroolsFact();
fact.setPreprocess1(true);
facts.add(fact);
System.out.println("rule5_preprocess1 fired");
end
```
@tkobayas - need your suggestions please.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]