You are here: Reference > Rule types > Functions > Function form - Completing the Parameters tab

Function form – Completing the Parameters tab

  1. About
  2. New
  3. Parameters
  4. Java
  5. Alias
  6. Imports & Exceptions
  1. History
  2. More...

The fields on the Parameters tab display input parameters for the function. Input parameters are initially defined on the Create or Save As form.

Note: Plan your parameters carefully. After you save the Create or Save As form, you cannot change the order or type of parameters on the Rule-Utility-Function ruleform. To address this situation, see Utility function instance management.

For reference purposes, a hashed version of the input parameters is contained within the rule signature.

Requirements

A function rule must have a fixed number of parameters. Pega Platform does not support variable-length argument lists.

Additionally, there must always be at least one parameter present, although the field can be left blank if the Rule-Utility-Function rule has no parameters.

Input Parameters

Field

Description

Name

This field is initially set on the Create or Save As form.

Enter a variable name that is an input to the function.

Description

Optional.

Enter a brief text description of this parameter.

Java type

This field is set on the Create or Save As form.

Pega type

Optional.

If the Java type field is String, you can choose a Pega Platform property Type value such as Date, Text, Decimal, or Integer, to validate the type at run time.

For other values of the Java type field, leave this field blank.

Page class

This field is for documentation purposes only.

If the Java type is ClipboardPage, identify the class name of the clipboard page that forms this input parameter.

In/out

Leave blank. This field is not used.

Output

Java Data Type

Enter a Java data type for the return value.

You can enter void here, but a property cannot obtain a value from a function with a void return, since you cannot use functions with a void return type to set a property value.

Pega Type

Optional.

If the return type is String, or is a primitive type (boolean, char, byte, short, int, long, float, or double), then identify the Pega type of a Single Value property.

Page Class

Optional.

If the return type is ClipboardPage, then identify the Pega Platform class (the name of a Rule-Obj-Class rule) of the clipboard page to be returned.

Classification

Usage Type

Leave blank. This field is not used.

Description

Leave blank. This field is not used.

Rule Type Parameters

You can map one or more of your input parameters to key parts of a specific rule type. Defining these associations supports traceability by updating the referencing rules for each collection that calls your function.

For example:

  1. Create a function named AddPendCode that takes one string parameter named CodeID.
  2. Map CodeID to the name key part of the Rule-PendCode class.
  3. Create a collection named ProcessPendCodes that calls the AddPendCode function and passes 17 as the CodeID value.

When you save your changes, a rule reference is created between the ProcessPendCodes collection and the instance of Rule-PendCode named 17.

To map an input parameter to a rule type:

  1. Click the add row icon.

  2. Select a fully qualified class name from the Rule type list.

    Available options are restricted to Rule- classes that have a category defined.

  3. Review the list of key parts for your selected rule type.

    Each item in the Key name column represents a key part on the General tab of the class.

  4. Enter an input parameter name in the Key value column next to each key part name.

    Alternatively, enter string values in these fields.

  5. Save the function.

At run time, the system uses the step page of the calling rule to determine the applies to key part for each rule type. You do not need to explicitly map an input parameter to this key part.

To pass parameters to a mapped rule type, see How to use parameter pages with a function alias.