Function Alias form – Completing the Reference tab

Complete these fields to define how the function alias appears and which function rule it executes. The appearance of this tab depends on the Applies To class of the rule; for the Embed-UserFunction class, complete the SQL fields.

After you save the rule form, click Actions > Preview to review the presentation of the alias rule. Click Actions > Run to test the function alias rule in conjunction with the function rule.

> SQL Function Alias Reference Input Parameters

Complete these fields to define an SQL function for use in report definitions

Field Description
Name Provide a name for each input parameter.
Description Provide a short meaningful description for each parameter.
Data type Select the appropriate data type from the drop-down menu.
Type Select an option for how the system prompts users to enter a value for this parameter within the template when this alias is selected:
  • Autocomplete — As the user starts to type an entry, the application provides available options that match the text entered.
  • SmartPrompt — To present properties through a SmartPrompt list, starting at the Applies To class of this alias rule.
  • Drop-down Menu — To require selection from a fixed list of constants (recorded on this form) or defined through the Table Type fields on the General tab of a property.
  • Property aliases — To allow users to select a property based on Rule-Obj-Property-Alias rules that belong to a specific category (and match the rulesets and Applies To class of the user context).
  • Textbox — To allow users to enter unedited text.
  • No Prompt — Users are not prompted for a value. The value is a constant or is provided by a clipboard property reference and appears in read-only format at runtime.
  • No Prompt (Hide) — The user is not prompted for a value. The value is a constant or is provided by a clipboard property reference and is not shown at runtime.
Default value If the parameter has a default value, select it from the list of available properties.
Optional Check the box if the parameter is optional.

> SQL Presentation

Field Description
Return type Select the return type for this SQL expression from the drop-down menu.
Category Select a category from the drop-down menu, or select the Edit button beside the menu to add a custom category.
Pattern template Enter the prompt text to display when the user edits this template in the Calculation Builder. Reference the input parameters by their row number in the Input Parameters table, surrounded by curly brackets, such as:
{3} characters from {1}, starting at position {2}

To see examples, review an existing SQL function alias rule.

Echo template Enter the text to display in a Report Definition rule using this SQL function alias in one of the columns of its report.
Output format Select an output format from the drop-down menu, or select the Edit button beside the menu to add a custom format.
Source Provide the syntax that generates the SQL text for this function here. You may use JSP tags such as <pega:choose > and <pega:when > to derive the correct text.

> Java Function Alias Reference

Complete these fields to define a function alias that references a Java function.

Field Description
Function Name Select a function name from the drop-down menu when creating the function alias. This populates fields in the Function reference section.
Function reference Information about the function that is populated after choosing a function name.
Name The name of the function ( Rule-Utility-Function rule type) that this rule provides an alias for. Click the Edit icon to review the function defined by the Name, Description, RuleSet, and Library fields.
Description The function description, from the function rule.
Library The library containing the function.
Ruleset The ruleset to which the function belongs.

> Java Input Parameters

This section contains a row for each function parameter in the order they appear in the function signature. You cannot add or delete rows from this section. Complete each row to determine whether and how users enter a value for the parameter. Every parameter must be accounted for, even if the corresponding parameter number does not appear in the Template field.

Field Description
1., 2., 3. Note the sequential number of each parameter, as this identifies the parameter in the Template text.
Name Name of the parameter, from the function rule.
Description Enter a short text description for this parameter as internal documentation of this function alias rule.
Type Select to determine how the system prompts users to enter a value for this parameter within the template when this alias is selected:
  • SmartPrompt — To present properties through a SmartPrompt list, starting at the Applies To class of this alias rule.
  • Drop-down Menu — To require selection from a fixed list of constants (recorded on this form) or defined through the Table Type fields on the General tab of a property.
  • Property aliases — To allow users to select a property based on Rule-Obj-Property-Alias rules that belong to a specific category (and match the rulesets and Applies To class of the user context).
  • Textbox — To allow users to enter unedited text.
  • No Prompt — Users are not prompted for a value. The value is a constant or is provided by a clipboard property reference and appears in read-only format at runtime.
  • No Prompt (Hide) — The user is not prompted for a value. The value is a constant or is provided by a clipboard property reference and is not shown at runtime.
  • HTML Property — The input field presentation is a control rule associated with a designated property. This may be a check box, radio buttons, a selection list, or other familiar input field format.
Default value Provide a literal constant default value for this parameter, or enter a property reference starting with a period.
Textbox size Enter the maximum length in characters that the text box should accommodate.

> Java Presentation

Field Description
Return type Select the type of the function return when this alias function rule is used. Ordinarily, this is the same as the type of the function, but you can choose another type if desired to cause the system to convert the result to a different (compatible) type. See Data type conversions in expressions.
Pattern template Enter a text description of this function suitable for display in decision rules. Surround references to parameters in this text by curly brackets. Identify each parameter by number, as:
Integer remainder of {1} divided by {2}

The system uses the Short Description of the function as the default text in this field, followed by all parameters in curly brackets. You can edit it as desired. Make sure all the parameters are identified, except for those you marked No Prompt (Hide).

About Function Alias rules