The Rule Template Editor
Comparing similar sections of the Rule Template editor and the Rule editor highlights the unique features of rule templates.
Configuration Section
The Configuration section is the same as the Configuration section in a rule. Priority, ranking, and forward chaining features work the same at runtime whether a rule is created using the Rule Editor or the Rule Template Editor.
Declarations and Variables Section
The Declarations and Variables section (declare in the source view) is similar to the Declaration section of a rule. However, in rule templates you can declare primitive types (as you can in rule functions). You can also define initial expressions for primitive types, for example, int j = 50;.
Pre-conditions Section
The Pre-conditions section (when in the source view) is similar to the Conditions section of a rule. However, WebStudio users can add additional conditions when defining individual business rules. The Pre-conditions section specifies conditions that must be met in all instances of a rule template before the rule’s actions execute.
Another difference is that the Pre-conditions section can contain non-conditional statements, for example, local variable declarations, to provide more flexible and comprehensive condition checking capabilities. Here is a simple example of such a section:
int i=con.prop1; int j=con2.prop1; i > j; i == j;
This feature enables complex calculations to be done before the definition of the condition. The Pre-conditions section could also contain conditions that might appear in any rule, such as the following:
con.prop1 > con2.prop1;