Surely you know de Morgan's laws? They apply equally to the conditions in<br>rules which are nothing but conditional expressions.<br><br>The Conditional Element "not" provides for negation, i.e., the absence<br>
of any fact with the given properties.<br><br>In addition to the implied "and" there is "or", to combine Fact matches.<br><br>Conditional operators for field tests have negated forms,<br>i.e., == and !=, or "contains" and "not contains".<br>
<br>Notice that there is one or two pitfalls in connection with the universal<br>quantifiers, e.g., "exists" should not be negated as "not exists" but<br>simply written as "not".<br><br>HTH<br>
-W<br><br><br><div class="gmail_quote">On Wed, Feb 17, 2010 at 8:22 AM, djb <span dir="ltr"><<a href="mailto:dbrownell83@hotmail.com">dbrownell83@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi,<br>
<br>
I've been playing with Drools for a few weeks now, using rule templates, but<br>
using mostly Java with eval(). I am now trying to re-write my program in<br>
DRL, (to get that sweet RETE working).<br>
<br>
<br>
I've got a situation where my rules are either "may not be" or "must be" in<br>
the condition.<br>
<br>
In Java, I work out everything assuming "may not be", and in the last line,<br>
return (negationMod ? result : !result);<br>
<br>
<br>
But in DRL... i'm a bit lost. I guess I'll have to split up the rule<br>
templates, one for "may not be" and one for "must be"? Is there a better<br>
way?<br>
<br>
Regards<br>
Daniel<br>
<font color="#888888"><br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://n3.nabble.com/Negating-a-result-tp212559p212559.html" target="_blank">http://n3.nabble.com/Negating-a-result-tp212559p212559.html</a><br>
Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>