Understanding Rule Template Creation

Time Administration in the Time and Labor application is a rules engine that executes the rules you specify to process reported and scheduled time. The system enables you to build custom, or non-template-based rules using SQL. However, many users prefer to create rules using templates that contain the basic logic, underlying structures and necessary SQL objects for a rule. Templates enable users that are not experts in SQL to create a variety of rules for the Time Administration program to execute when processing reported and scheduled time.

Rule templates define the set of SQL statements that are required to enact a particular type of rule. The template is very similar to a rule, except that the SQL objects contain pre-defined variables where values can be inserted. The template also defines and controls the user interface where users who may not have extensive rule-building skills can input the functional criteria that make up the rule. The template continues to list the rule steps and the SQL objects upon which the parameters entered by the user are applied to generate the executable code specific to each rule. A template also defines how the information, or parameters, from the user interface fit into the template’s explanation and the template’s executable steps, or SQL objects.

SQL objects that are subject to customization have placeholders, specifically %RuleTemplate(), that are replaced with information specific to the rule in order to create the executable Application Engine (AE) section and its SQL steps.