[rules-users] Negating a result

Wolfgang Laun wolfgang.laun at gmail.com
Wed Feb 17 03:48:50 EST 2010


Please be more specfic. If your field is called "foo", then
should have a method in the class representing
your fact, such as:

   boolean getFoo(){
       return <condition> ? ! (<expression>) : <expression>;
   }

Basically, <condition> could be a global parameter (public static final)
or a static or regular method call. <expression> could depend on other
attribute values, and so on.

You can then write your CEs with a test such as
  foo == true

But I think this is closely related with that other question you
have posted.

-W


On Wed, Feb 17, 2010 at 9:32 AM, djb <dbrownell83 at hotmail.com> wrote:

>
> Hi Wolfgang,
>
> Sure, I know de Morgan's laws, but I'm not asking how one can negate a
> condition...
>
> I'm asking how one can either negate or not negate, based on a test... and
> whether I'm going to have to split my spreadsheet/rule-template into 2,
> (i.e. 1 for "may not be" rules, 1 for "must be" rules).
>
> My spreadsheet has a field that in Java would be expressed as field ?
> !finalResult : finalResult
>
> But in DRL, it seems the lack of a ternary operator means I have to split
> my
> rule-set, and I'm just checking if this is the case.
>
> -Daniel
>
> --
> View this message in context:
> http://n3.nabble.com/Negating-a-result-tp212559p212656.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100217/18c19147/attachment.html 


More information about the rules-users mailing list