[rules-users] Division Operator in a Rule Condition

Edson Tirelli ed.tirelli at gmail.com
Fri Oct 2 12:22:31 EDT 2009


   Left hand side of a constraint must always be a field name. If you need
expression there, either do what wolfgang suggested or wrap the whole thing
in an eval().

   []s
   Edson

2009/10/2 Greg Barton <greg_barton at yahoo.com>

> Try wrapping it in parentheses:
>
> A ($b:b, $c:c, ($b/$c) <=105)
>
>
>
> ----- Original Message ----
> From: skasab2s <skasab2s at smail.inf.fh-brs.de>
> To: rules-users at lists.jboss.org
> Sent: Friday, October 2, 2009 10:20:52 AM
> Subject: [rules-users]  Division Operator in a Rule Condition
>
>
> Hello guys,
>
> I have this problem:
>
> I have an object A with fields b and c. I have to check if b/c <= 105 (if
> the division of the both fields is less than 105).
>
> When I try the condition  A ($b:b, $c:c, $b/$c <=105), I get the error
> message "No viable alternative for /".
>
> How to check this one correctly in a rule condition?
>
> Thanks a lot for any ideas!
>
> skasab2s
>
>
> --
> View this message in context:
> http://www.nabble.com/Division-Operator-in-a-Rule-Condition-tp25716712p25716712.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
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091002/3a9a2473/attachment.html 


More information about the rules-users mailing list