Creating Rule Templates
Time and Labor provides a component for creating and maintaining template definitions. The component enables validation of the data entered and provides full isolation of any template-specific PeopleCode from PeopleSoft delivered updates.
Page Name |
Definition Name |
Usage |
---|---|---|
TL_TMPLT_DEFN |
Create and review the contents of rule templates. |
|
TL_TMPLT_STEPS |
Create the template rule steps, which define the logic of any rules created by a template. |
|
Rules Built From Template Page |
TL_TMPLTRULE_REF |
Lists the rules that are created from the template based on a view against the TL_TMPLT_RULE table. |
TL_TMPLT_TEXT_SP |
Specify the parameters for each placeholder in the pre-defined message that the system generates for rules when you specify a rule explanation message. |
|
TL_TMPLT_PARM_SP |
Lists the name of the record holding the parameter in the rule component interface and displays the template SQL defined for the step with the %RuleTemplate() place-holders where the parameters fit. |
Use the Template Definition page (TL_TMPLT_DEFN) to create and review the contents of rule templates.
Navigation:
This example illustrates the fields and controls on the Template Definition page. You can find definitions for the fields and controls later on this page.
![Template Definition page](img/i-72fe8c86n-7e60.png)
Field or Control |
Description |
---|---|
Save As ... |
Select to duplicate a template definition by giving it a different name, or create a template definition that is similar to an existing definition or a PeopleSoft-delivered template definition. Important! When you use the Save As... button to create the copy, the system saves the source object with any modifications prior to selecting the Save As ... button. You should always create the copy first, and then make changes to the object. |
List of Rules |
Click to access the Rules Built From Template page in order to view a list of the rules that have been created from this template. |
Template Type |
Select an option to filter the search results returned when the user accesses the template built rules component. |
Core Component |
Select to mark this template as a core component. The Time and Labor application makes any core components read-only when they are saved. |
Note: To understand the effects of different time selections and period filters, review the existing templates and rules and observe how the Template Header page behaves for templates that use the different settings.
Header Page Controls
Field or Control |
Description |
---|---|
Time Selection |
Select the punch types available when creating a rule, and whether a selection is required. The values are:
Select Controlled By Code when the list of enabled, defaulted, and required punch types does not fit within any of the other field values. When you select this option you must provide explicit logic in an application class to display and validate the appropriate combination of selectors. |
Profile Selection |
Select the Task Profile Assignment options for any rules created by this template. This selection only applies to rules that add new Intermediate Payable Time (IPT) and needs to fill in the task information on the new row and has no impact on rules that generate exceptions or alter content on existing rows. Select Not Applicable for Template to disable the Task Profile Assignment during the creation of rules. The values are: Enable Selection, Not Applicable for Template, and Use Previous Row Tasks. |
Period Filter |
Enter the calendar table name to specify the calendars that the user can select in the Period ID field on the Template Header page. For example, you generally would not want to enable a user to enter a weekly calendar for a daily threshold rule. For templates where the calendar is not applicable, enter the TL_PERIOD_NA_VW table. |
Detail Page Controls
Field or Control |
Description |
---|---|
Detail Page |
Specify the page to use for entering and displaying parameters. Two generic pages, TL_TEMPLATE_GEN and TL_TEMPLATE_GRID, support custom template development and provide more options if you do not want to modify the delivered component object. |
Message Set (Optional) |
Enter the Message Set Number for the translatable text that the system uses to generate explanations for rules created by this template. Use with the Message Numbers field. |
List Type (Optional) |
Select the list of values, if any, from which the user selects. Templates normally use only one List field. |
Message Number (Optional) |
Enter the Message Number for the translatable text that the system uses to generate explanations for rules created by this template. Use the Template Text Parameters page to specify the parameters for each placeholder in the pre-defined message. Use with the Message Set field. |
Text Parameters |
Click to access the Template Text Parameters page. Use the Template Text Parameters page to specify the parameters for each placeholder in the pre-defined message specified by the Message Set and Message Number fields |
Action |
Specify whether the default setting for rules created by this template is to replace the incoming reported time or add an extra IPT entry. The values are: Create as Replacement, Create in Addition, and Not Applicable. |
Template Controlling Code
The fields in this section enable you to create separate application classes that isolate your custom code from the delivered code. This means that future Time and Labor upgrades will not overwrite your custom templates.
Field or Control |
Description |
---|---|
Use Dedicated App Class (Use Dedicated Application Class) |
Select to enable you to enter values in the Root Package ID and Package Name fields. |
Root Package ID |
Enter the name of the application package for this template. All delivered templates use the TL_RULETEMPLATES Root Package ID. |
Package Name |
For custom packages the Package Name is optional and the application class can be placed under the root package. The package name must be identical to the template ID. All delivered templates use the TL_RULETEMPLATES Root Package ID with a default Package Name of PSFT. |
See the product documentation for PeopleTools: PeopleCode Developer's Guide
Use the Template Steps page (TL_TMPLT_STEPS) to create the template rule steps, which define the logic of any rules created by a template.
Navigation:
This example illustrates the fields and controls on the Template Steps page. You can find definitions for the fields and controls later on this page.
![Template Steps page](img/i-72fe8c86n-7e5f.png)
Field or Control |
Description |
---|---|
AE Action |
Select the type of step based on basic Application Engine technology. If you select Do Select, Do When, or Do While you must also add a SQL statement in the same rule step. SQL-Standard and SQL-Quit If No Rows are both single action steps. Selecting SQL-Quit If No Rows produces a SQL step with attributes that skip the remaining steps in the rule section unless this statement produced or returned any rows. The values are: SQL-Standard, Do Select, Do When, Do While, and SQL-Quit If No Rows |
Statement Type |
Select the type of SQL statement. You must also indicate the table to update or truncate, or the SQL object or action. A typical rule truncates, or deletes the content of its work tables, and then defines the actual rule logic by copying relevant information into its work tables. There may be intermediate steps that update the statistics on these tables for better performance. The values are: Action, SQL Object, Truncate Work Table, Update Statistics. |
Record (Table) Name and SQL Object ID |
Depending upon the selected Statement Type value, you must indicate either a table or SQL object. You must indicate a table to update or truncate when you select Truncate Work Table or Update Statistics in the Statement Type field. You must indicate an SQL object or action when you select Action or SQL Object in the Statement Type field. |
Edit SQL |
Click to access the SQL Object page to edit the SQL for the specified rule step. |
Parameters |
Click to access the Template Step Parameters page. |
Defining Template Rule Steps
Define template rule steps in the following manner:
Number the steps in execution order.
Indicate the Action type.
Indicate the Statement Type and the related object. Depending upon the selected Action type, you need to indicate at least one of the following:
The table to update or truncate.
The SQL object or action to run.
Review and edit the SQL object or action using the Edit SQL button for each rule step.
Note: The interface automatically detects the number of parameters required by the rule object and updates the template step. However, if you change the number of parameters in a rule object you have used within a Rule Template, the number of parameters displayed is not updated automatically, due to caching reasons. You will need to go into the Rule Template again.
Specify the parameter mapping for each statement that requires parameters using the link in the Parameters column.
Use the Template Text Parameters page (TL_TMPLT_TEXT_SP) to specify the parameters for each placeholder in the pre-defined message that the system generates for rules when you specify a rule explanation message.
Navigation:
Click the Text Parameters link on the Template Definition page.
This example illustrates the fields and controls on the Template Text Parameters page. You can find definitions for the fields and controls later on this page.
![Template Text Parameters page](img/i-cd7d26dn-70e7.png)
Field or Control |
Description |
---|---|
Sequence Number |
The system automatically assigns the value of this field, and links the specified parameters in each row with each placeholder in the template message. In the Description field, each placeholder is numbered, based on this sequence number. |
Record Name and Field Name |
Enter the source of the parameter for each placeholder in the template message |
List Type |
Select the type of list. Use this field when the specified field is not a single value item, but a List ID for multiple values that must be expanded from the value list definition. |
Description |
Displays the message text from the selected Message Catalog entry. Use the text in this field as a guide for defining the necessary parameters on this page. |
Note: Enter a single TRC using the TRC field, or a list of TRCs using the LIST_ID field. When entering a list of TRCs, enter TRC in the Field Name and the List Type for that parameter.
Use the Template Step Parameters page (TL_TMPLT_PARM_SP) to map parameters within a step while viewing the template SQL. This page lists the name of the record holding the parameter in the rule component interface and displays the template SQL defined for the step with the %RuleTemplate() place-holders where the parameters fit.
If the defined parameter occurs on the first page of a Rule definition, the common page, then the record hosting the parameter is TL_TMPLT_RULE. If the defined parameter is on the detail page, the record hosting the parameter is either DERIVED_TL_TMPL, or your custom record of choice.
Navigation:
Click the Parameters link in the Text Parameters column on the Template Steps page.
This example illustrates the fields and controls on the Template Step Parameters page. You can find definitions for the fields and controls later on this page.
![Template Step Parameters Page](img/i-cd7d26dn-70f9.png)
Field or Control |
Description |
---|---|
Required Field |
Select to indicate that the parameter must have a value. Deselect this field to allow a zero numeric value or an empty character field for this parameter. |
Field Format |
Select the format of the field, based on the definition of the selected field. The selected value in this field deals with the formatting of the parameter into the SQL statement. Select Character without Quotes to allow a character value that does not have quote wrappers. For example, in the statement “ ...AND TRC = ‘KUREG’…” KUREG has quote wrappers that identify the character value for the time reporter code. However, when you have logical or mathematical operators, such as >, or <, you do not want the character value surrounded by quote wrappers. The values are: Character, Character without Quotes, Date, Date and Time, Numeric, Signed Numeric, and Time. |