Lists Home |
Date Index |
this is very close in concept to unibase rules.
i prefer to think of it as "if you need tax amount here's how to
calculate it". then it really is a rule. and can be changed at will.
a rule is an expression (even the ai rules are at the end of the day
just expressions - as noted).
there is however a big difference between the idea that if subtotal or
taxpercent change then recalculate taxamount and what i outlined. in the
latter there is an implication that taxamount exists somewhere and has
to be maintained. in the former taxamount doesn't exist unless you need
it. this late binding means that if the definition of tax amount changes
between use, the so does the value.
there's a whole new world of perma threads here involving is it more
efficient to store and change or calculate as needed ;) we've argued
this one in the dbms world for so long i think there is a sort of uneasy
truce between camps. we use late binding mostly so we can add/subtract
rules as required, but that's our position.
once i work out the yahoo groups thing, i'll contribute directly.
Waleed Abdulla wrote:
>>From: Jonathan Borden [mailto:email@example.com]
>> <xr:ruleset context="/PurchaseOrder">
>> <xr:calculate target="TaxAmount" value="SubTotal * TaxPercent" />
>>What makes this a rule? It looks like a variable declaration, or simply an
>Think of it like:
> Value of SubTotal changes
> Value of TaxPercent changes
> Recalculate TaxAmount = SubTotal * TaxPercent
>This is how the XRules processor (the DynamicDOM) handles it. The syntax is
>simplified to make the language easier to edit and maintain. I've seen some
>rules engines express the same rule as:
> If True (to indicate that the rule always apply)
> Then TaxAmount = SubTotal * TaxPercent
>Which accomplishes the same thing, but with a different syntax.
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>To subscribe or unsubscribe from this list use the subscription
tel;cell:+61 411 287 530