[Home] [By Thread] [By Date] [Recent Entries]



> -----Original Message-----
> From: Jonathan Borden [mailto:jonathan@o...]
> 
>   <xr:ruleset context="/PurchaseOrder">
>     <xr:calculate target="TaxAmount" value="SubTotal * TaxPercent" />
>   </xr:ruleset>
> 
> What makes this a rule? It looks like a variable declaration, or simply an
> expression.
> 

Think of it like:

	If 
	   Value of SubTotal changes
	 OR
	   Value of TaxPercent changes
	Then
 	   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.

Regards,
Waleed
http://www.xrules.org




Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member