]
Mark Proctor closed JBRULES-1559.
---------------------------------
Resolution: Rejected
Not sure what to do with this, so closing. Please come back with more complete suggestions
if you wish to push this further.
Ability to negate a constraint group
------------------------------------
Key: JBRULES-1559
URL:
https://issues.jboss.org/browse/JBRULES-1559
Project: Drools
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: drools-compiler
Affects Versions: FUTURE
Reporter: Dirk Bergstrom
Assignee: Edson Tirelli
Priority: Minor
I want to write a rule that says "Find all long-eared dogs that do not have
short, black hair". This seems like the simple way to do it:
collect( Dog( ears=="long",
not (hair=="short" && color=="black")
)
But that doesn't parse. Some digging through the archives unearthed a mention
of De Morgan's laws, which leads to:
http://en.wikipedia.org/wiki/De_Morgan's_laws
Which explains that I can instead write:
collect( Dog( ears=="long", (hair!="short" ||
color!="black") )
Which, after some mental effort, turns out to be the right thing.
However, had I not found the reference to De Morgan's Law, it would have taken
me a long time to get there (if indeed I ever would have). The end result is
also quite difficult to parse if you're not a logician, and thus not very
user-friendly.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: