RuleLab.Net Data Types and Formats

 

The RuleLab.Net lets you select data type for each XML Reference which enables your application to associate a data type with the corresponding XML node in your data document. The data type allows the Rule Designer to format data input fields according to its type. The BRE checks data syntax and parses data values based on its type at runtime. Application data must be passed to the BRE in a format according to its type, otherwise, the BRE will return an error.

 

The following Data Types are supported:

 

Text – non-restricted set of characters. There are several functions that you can apply to the text entries such as “text length” and “regular expression match”.

 

Numeric – numbers, minus sign and dot only. You can apply math functions to the Numeric fields.

 

Date – valid date value in mm/dd/yyyy format

 

Time – valid time value in hh:mm format

 

Currency – monetary value prefixed by the currency symbol. Supports same functions as the Numeric fields.

 

You can overwrite the default currency symbol of ‘$’ by entering the preferred currency symbol in the Account Preferences. Currency symbol is utilized by the Rules Designer and the Web Service to present data entered and calculated monetary values.

 

Since the offline BRE does not have an access to the Account, methods exist for setting the currency symbol via the BRE assembly and the COM interface.

 

Monetary data is accepted with or without cents. When data is assigned, the BRE rounds to/pads it with two cent digits and prepends the

currency symbol.

 

Application can send monetary data with or without the currency symbol. But if the specified symbol does not match the Account/Preferences currency symbol setting under the Web Service method call or the CurrencySymbol parameter in the offline BRE call, then an error will occur. A few examples of the acceptable formats:

 

 

<price>100</price>

<price>100.00</price>

<price>$100</price>

<price>$100.00</price>

 

If the symbol is set to ‘€’ then passing <price>$100.00</price> will trigger a syntax error.

 

Note that using currency symbol may conflict with XPath expression should you select nodes by comparing with the amount, for example:

/customer/purchases//item[price > 300.00]/date.

 

No currency conversion is taking place in the current version of the RuleLab.Net.