You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "tkobayas (via GitHub)" <gi...@apache.org> on 2025/11/25 09:56:43 UTC

[I] executable-model misses to flag passive for a pattern with FromNode [incubator-kie-drools]

tkobayas opened a new issue, #6529:
URL: https://github.com/apache/incubator-kie-drools/issues/6529

   https://kie.zulipchat.com/#narrow/channel/232677-drools/topic/Strange.20behaviour.20with.20traditional.20syntax.20in.20RuleUnit/with/558621566
   
   ```
   package com.example.ruleunit
   
   unit PersonUnit
   
   import com.model.Person
   import com.model.Child
   import com.model.House
   import com.model.School
   
   rule "Rule 1"
   when
       $person: Person() from entry-point people
       exists Child(age > 18) from $person.children
       not School() from entry-point schools
       House() from entry-point houses
   then
       rulesFired.add("rule1");
   end
   
   rule "Rule 2"
   when
       House() from entry-point houses
       $person: Person() from entry-point people
       exists Child(age > 18) from $person.children
       not School() from entry-point schools
   then
       rulesFired.add("rule2");
   end
   ```
   Rule1 fires, but Rule2 doesn't.


-- 
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: commits-unsubscribe@kie.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [I] executable-model misses to flag passive for a pattern with FromNode [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas closed issue #6529: executable-model misses to flag passive for a pattern with FromNode
URL: https://github.com/apache/incubator-kie-drools/issues/6529


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [I] executable-model misses to flag passive for a pattern with FromNode [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on issue #6529:
URL: https://github.com/apache/incubator-kie-drools/issues/6529#issuecomment-3584216675

   Fixed by https://github.com/apache/incubator-kie-drools/pull/6530


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [I] executable-model misses to flag passive for a pattern with FromNode [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on issue #6529:
URL: https://github.com/apache/incubator-kie-drools/issues/6529#issuecomment-3584356831

   Workarounds until 10.2.0 will be released:
   
   - Use non-RuleUnit / non-executable-model : The issue happens only with executable-model (regardless of RuleUnit). So the workaround is to use non-executable-model, which means to use the the traditional DRL without RuleUnit and configures the dependency `drools-engine-classic`. The doc says `drools-engine-classic` is deprecated, but it still works and can be a workaround until 10.2.0 will be released.
   
   - Avoid `exists XXX from` : The bug is related to `exists XXX from`. It doesn't mean that `exists XXX from always` causes the issue, but if you replace `exists XXX from` with a different expression, the issue would disappear.
   
   For example)
   ```
   import static com.model.Utils.hasChildOlderThan;
   
   rule "Rule 2"
   when
       House() from entry-point houses
       $person: Person() from entry-point people
       //exists Child(age > 18) from $person.children
       eval(hasChildOlderThan($person, 18))
       not School() from entry-point schools
   then
       rulesFired.add("rule2");
   end
   ```
   ```
   public class Utils {
       public static boolean hasChildOlderThan(Person person, int age) {
           return person.getChildren().stream().anyMatch(a -> a.getAge() > age);
       }
   }
   ```
   If you are migrating from old drools version, probably the first option (non-executable-model) is easier. Traditional DRL is still fully supported, so you are not forced to use RuleUnit.


-- 
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: commits-unsubscribe@kie.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org