tkobayas commented on issue #6543:
URL:
https://github.com/apache/incubator-kie-drools/issues/6543#issuecomment-3645033652
Yes, a bind variable `$f` with `not` doesn't work.
> Can I solve it like this, is there any performance impact with approach ?
From performance perspective, changing from `update` to `insert`/`add` would
be small or negligible.
> Any other rule gets impacted by this fact?
I cannot tell the semantic impact, because I don't know your rules.
One advice is to use "Control Fact" for such `preprocess1` flags.
```
public class ControlFact {
private boolean preprocess1;
...
}
```
```
rule "rule5_preprocess1"
when
...
then
ControlFact controlFact = new ControlFact();
controlFact.setPreprocess1(true);
controlFacts.add(controlFact);
end
rule "rule2"
when
...
/controlFacts [ preprocess1 == true, preprocess2 == true, preprocess3 ==
true, preprocess4 == true ]
...
/facts...
```
It makes clear that ControlFact is used for rule control purpose and is not
related to business domain.
Btw, it looks odd to me that you mix `/facts` and `not /facts` in one rule,
because `/facts` matches one fact and `not /facts` matches when "checking all
facts in working memory and there is no fact which meets the condition". Is it
intentional? Can't you replace `not /facts[ name == "location.city" ]` with
`/facts[ name != "location.city" ]"`?
--
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]