[rules-users] Issue with operator || in Drools 5.0.1

Edson Tirelli tirelli at post.com
Tue Jul 28 18:15:22 EDT 2009


   Chris,

   I was not able to reproduce this problem in trunk. Nevertheless, I added
one more integration test for it. If you are able to reproduce it, please
create a test case and open a JIRA and I will check it out.

$ svn commit -m "Adding integration test"
drools-compiler/src/test/java/org/drools/Person.java
drools-compiler/src/test/java/org/drools/integrationte
sts/MiscTest.java
drools-compiler/src/test/resources/org/drools/integrationtests/test_ConstraintConnectorOr.drl
Sending        drools-compiler/src/test/java/org/drools/Person.java
Sending
drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
Adding
drools-compiler/src/test/resources/org/drools/integrationtests/test_ConstraintConnectorOr.drl
Transmitting file data ...
Committed revision 28549.

   []s
   Edson

2009/7/28 Chris Gibble <cgibble at excite.com>

> My apologies if this has already been answered elsewhere -- I searched and
> could not find it.
>
> I have a java class that takes this form (simplified for purposes of this
> discussion):
>
> public class MyClass()
> {
>    public boolean isHappy();
>    public boolean isHealthy();
> }
>
> I have a rule that looks like this:
>
> rule "Some rule"
>     salience 100
>     when
>          $obj : MyClass(happy == true || healthy == true)
>     then
>           // Do something with $obj
> end rule
>
>
>
> In Drools 4.x, this rule would perform the conclusion when either
> MyClass.isHappy() returned true or MyClass.isHealthy() returned true, but
> not if both were false.
>
> In Drools 5.0.1, this rule would perform the conclusion *always* --
> regardless of the values of isHappy() or isHealthy().
>
> Any ideas what's going on?  Is this a known problem, or is there something
> wrong with my syntax and/or class?
>
>
>
> Thanks for any help you can give -- and I can give a more concrete example
> if need be.
> ------------------------------
>       Bamboo Flooring<http://tagline.excite.com/fc/FgElN1gz4wwE6UWjuk9HgExVihsl6SoJRYkCYdqtuEKvZKZG6s3cKDjBdiI/>  The
> strong, silent type. Click here for great looking bamboo flooring!<http://tagline.excite.com/fc/FgElN1gz4wwE6UWjuk9HgExVihsl6SoJRYkCYdqtuEKvZKZG6s3cKDjBdiI/>  Click
> Here For More Information<http://tagline.excite.com/fc/FgElN1gz4wwE6UWjuk9HgExVihsl6SoJRYkCYdqtuEKvZKZG6s3cKDjBdiI/>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090728/ae0c86c1/attachment.html 


More information about the rules-users mailing list