<html><body bgcolor="#FFFFFF"><div>You can use not(Person(age &gt; 30))</div><div>greetings<br><br><div>- CTO @ <a href="http://www.plugtree.com"><a href="http://www.plugtree.com">http://www.plugtree.com</a></a></div><div>- MyJourney @ <a href="http://salaboy.wordpress.com"><a href="http://salaboy.wordpress.com">http://salaboy.wordpress.com</a></a></div><div>- Co-Founder @ <a href="http://www.jbug.com.ar"><a href="http://www.jbug.com.ar">http://www.jbug.com.ar</a></a></div>- Mauricio "Salaboy" Salatino -</div><div><br>On 10/03/2011, at 06:09, Manuel Ortiz &lt;<a href="mailto:manuel.ortizramos@gmail.com">manuel.ortizramos@gmail.com</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div><ul><li>Dear all:</li></ul><div><br></div><div>My name is Manuel Ortiz, a very beginner in Drools, and have a question related to Multi Restriction on Condition Elements.</div><div><br></div><div>In&nbsp;<a href="http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch04.html#RuleLanguage-ConditionalElements"><a href="http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch04.html#RuleLanguage-ConditionalElements">http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch04.html#RuleLanguage-ConditionalElements</a></a>, it can be found the following example:</div>
<div><br></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-size: 12px; line-height: 18px; "><a id="d0e4343"><p class="title">
<b>Example&nbsp;4.52.&nbsp;Multi Restriction</b></p><div class="example-contents"><pre class="" style="font-size: 0.9em; font-family: courrier, monospace; display: block; background-color: rgb(245, 245, 245); color: rgb(51, 51, 51); overflow-x: auto; overflow-y: auto; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 25px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); ">// Simple multi restriction using a single &amp;&amp;
Person( age &gt; 30 &amp;&amp; &lt; 40 )
// Complex multi restriction using groupings of multi restrictions
Person( age ( (&gt; 30 &amp;&amp; &lt; 40) ||
              (&gt; 20 &amp;&amp; &lt; 25) ) )
// Mixing muti restrictions with constraint connectives
Person( age &gt; 30 &amp;&amp; &lt; 40 || location == "london" )</pre></div></a></span></div><div>I need to test a multi restriction in a rule and the opposite restriction in another. The multi restriction will be given by the user, and the application will build rules which test both the original restriction and the opposite.&nbsp;I would like to know if it is possible to write a Drools rule which evals the opposite conditions based on the original, something like</div>
<div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-size: 12px; line-height: 18px; "><a id="d0e4343"><div class="example-contents">
<pre class="" style="font-size: 0.9em; font-family: courrier, monospace; display: block; background-color: rgb(245, 245, 245); color: rgb(51, 51, 51); overflow-x: auto; overflow-y: auto; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 25px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); ">Person( !(age &gt; 30 &amp;&amp; &lt; 40) )</pre></div></a></span></div><div>or I have to rebuild the multi restriction, something like</div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'Lucida Grande', Geneva, Verdana, Arial, sans-serif; font-size: 12px; line-height: 18px; "><pre class="" style="font-size: 0.9em; font-family: courrier, monospace; display: block; background-color: rgb(245, 245, 245); color: rgb(51, 51, 51); overflow-x: auto; overflow-y: auto; padding-top: 5px; padding-right: 15px; padding-bottom: 5px; padding-left: 25px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); ">Person( age &lt;= 30 || &gt;= 40 )</pre></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: courrier, monospace; font-size: 11px; line-height: 18px; white-space: pre; "></span>Thank you in advance for your time.</div>
<div><br></div><div>Kind regards,</div><div><br></div><div>Manuel Ortiz</div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a></span><br><span><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a></span><br></div></blockquote></body></html>