[rules-users] Rule in decision table

Wolfgang Laun wolfgang.laun at gmail.com
Sat Feb 20 02:06:12 EST 2010


Do not use an expression to the left of the comparison operators <,
>=, etc. Instead of
   weight * area > ($param * 453.5924))
use the equivalent
   weight >  ($param * 453.5924)/area

-W


2010/2/19 Jeffrey Schneller <jeffrey.schneller at envisa.com>:
> I am trying to write a condition for a decision table and can’t seem to
> figure out how to do it.
>
>
>
> I have a global variable called area.  This is in sq. ft.
>
>
>
> I have a fact called Item which has an attribute called weight.  This is in
> grams / sq. ft.
>
> The Item comes from the attribute called value from a fact named Choice
> where the sku attribute matches what is in the rule
>
>
>
> I want to compare the (weight * area) to the parameter for the row.  The
> parameter is being passed in as lbs.
>
>
>
> Here is what I tried for my three condition columns:
>
>
>
> CONDITION
> CONDITION
> CONDITION
>
> mm : Choice
>
> sku
> exists(Item(weight * area > ($param * 453.5924)) from
> mm.value)
> exists(Item(weight * area <= ($param * 453.5924)) from mm.value)
>
>
>
>
>
> This did not work.  This will work if I remove the formula and just do
> something like exists(Item(weight > $param) from mm.value).   So the syntax
> is correct except for the comparison that I want to do.
>
>
>
> Any ideas on how to do this?
>
>
>
> Thanks.
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>




More information about the rules-users mailing list