[rules-users] Division Operator in a Rule Condition

Wolfgang Laun wolfgang.laun at gmail.com
Fri Oct 2 11:57:49 EDT 2009


Check the "Expert" manual. What you need here is a so-called "Return Value
Restriction" where you relate a field and a parenthesized expression using a
relational operator; i.e.: <field> <op> ( <expr> )

Therefore, $b/$c <= 105 is not correct, but $b <= ( 105*$c ) is (apart from
possible truncation if $b and $c are integers).

-W


On Fri, Oct 2, 2009 at 5:20 PM, skasab2s <skasab2s at smail.inf.fh-brs.de>wrote:

>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091002/d1af21e5/attachment.html 


More information about the rules-users mailing list