<br>&nbsp;&nbsp;&nbsp; Haaaaa!!! :)<br><br>&nbsp;&nbsp;&nbsp; I knew there would be a use case for a constraint negative operator (not/!)!! <br>&nbsp;&nbsp;&nbsp; Sorry, it is not available in 4.0 but you can open a feature request and I may add it to the next release! :)
<br><br>&nbsp;&nbsp;&nbsp; Anyway, there are other ways. Just to make sure I understand your case, can you please state your rules in plain English? I think there may be easier ways to express them then the way you showed bellow.<br><br>
&nbsp;&nbsp;&nbsp; []s<br>&nbsp;&nbsp;&nbsp; Edson<br><br><div><span class="gmail_quote">2007/7/25, Yuri de Wit &lt;<a href="mailto:ydewit@gmail.com">ydewit@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have a case where I need to negate only part of the predicates.<br><br>RULE1<br>when:<br>&nbsp;&nbsp;c1 : Child()<br>&nbsp;&nbsp;c2 : Child(hashCode &lt; c1.hashCode, prop1==c1.prop1, ... propN==c1.propN)<br>then:<br>&nbsp;&nbsp;insert(new Parent(c1, c2));
<br><br>RULE2<br>when<br>&nbsp;&nbsp;p:Parent()<br>&nbsp;&nbsp;c1:Child(this memberOf p)<br>&nbsp;&nbsp;not Child(this memberOd p, prop1==c1.prop1, ...propN==c1.propN)<br>then<br>&nbsp;&nbsp;retract(p);<br><br>While in rule1 I use a matching criteria to group c1 and c2, in rule2
<br>I want to use the inverse of the same exact criteria to ungroup them.<br>I dont care which propN no longer holds, as long as the any of the<br>propN no longer holds. The problem is that I still need the &quot;positive&quot;
<br>this memberOf p. How to solve this problem?<br><br>RULE2<br>when<br>&nbsp;&nbsp;p:Parent()<br>&nbsp;&nbsp;c1:Child(this memberOf p)<br>&nbsp;&nbsp;Child(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this memberOd p,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;not(prop1==c1.prop1, ...propN==c1.propN)<br>&nbsp;&nbsp;)<br>
then<br>&nbsp;&nbsp;retract(p);<br><br>(afaik, not supported)<br><br>any ideas?<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">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>&nbsp;&nbsp;Edson Tirelli<br>&nbsp;&nbsp;Software Engineer - JBoss Rules Core Developer
<br>&nbsp;&nbsp;Office: +55 11 3529-6000<br>&nbsp;&nbsp;Mobile: +55 11 9287-5646<br>&nbsp;&nbsp;JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>