You can use not(Person(age > 30)) greetings - CTO @ http://www.plugtree.com - MyJourney @ http://salaboy.wordpress.com - Co-Founder @ http://www.jbug.com.ar - Mauricio "Salaboy" Salatino -
On 10/03/2011, at 06:09, Manuel Ortiz <manuel.ortizra...@gmail.com> wrote: > Dear all: > > My name is Manuel Ortiz, a very beginner in Drools, and have a question > related to Multi Restriction on Condition Elements. > > In > http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch04.html#RuleLanguage-ConditionalElements, > it can be found the following example: > > Example 4.52. Multi Restriction > > // Simple multi restriction using a single && > Person( age > 30 && < 40 ) > // Complex multi restriction using groupings of multi restrictions > Person( age ( (> 30 && < 40) || > (> 20 && < 25) ) ) > // Mixing muti restrictions with constraint connectives > Person( age > 30 && < 40 || location == "london" ) > 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. 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 > Person( !(age > 30 && < 40) ) > or I have to rebuild the multi restriction, something like > Person( age <= 30 || >= 40 ) > Thank you in advance for your time. > > Kind regards, > > Manuel Ortiz > _______________________________________________ > rules-users mailing list > rules-users@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users