Surely you know de Morgan&#39;s laws? They apply equally to the conditions in<br>rules which are nothing but conditional expressions.<br><br>The Conditional Element &quot;not&quot; provides for negation, i.e., the absence<br>
of any fact with the given properties.<br><br>In addition to the implied &quot;and&quot; there is &quot;or&quot;, to combine Fact matches.<br><br>Conditional operators for field tests have negated forms,<br>i.e., == and !=, or &quot;contains&quot; and &quot;not contains&quot;.<br>
<br>Notice that there is one or two pitfalls in connection with the universal<br>quantifiers, e.g., &quot;exists&quot; should not be negated as &quot;not exists&quot; but<br>simply written as &quot;not&quot;.<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">&lt;<a href="mailto:dbrownell83@hotmail.com">dbrownell83@hotmail.com</a>&gt;</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&#39;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&#39;ve got a situation where my rules are either &quot;may not be&quot; or &quot;must be&quot; in<br>
the condition.<br>
<br>
In Java, I work out everything assuming &quot;may not be&quot;, and in the last line,<br>
return (negationMod ? result : !result);<br>
<br>
<br>
But in DRL... i&#39;m a bit lost.  I guess I&#39;ll have to split up the rule<br>
templates, one for &quot;may not be&quot; and one for &quot;must be&quot;?  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>