Calling an overloaded function

Pega Platform allows multiple function rules to be defined with the same name, in the same ruleset, version, and library, if they have different signatures. The signature of a function is computed automatically from the name, the position and data types of parameters, and the return type. Functions that have multiple variants are called overloaded.

When calling an overloaded function, you do not need to specify which variant to use. The system determines which to use based on the types and positions of parameters you supply.

For example, assume one function named Round is defined with two variants:

  • Round(double: d) — Returns an int by rounding the input value d, a double
  • Round(double: d, places: n) — Returns a double by rounding the value to n decimal places

If your call includes two parameters, the system uses the second variant.