Table of Contents

Optimizing strategies with whitelist functions in Pega 7.4

When a globally optimized strategy cannot be optimized because its component or components contain expressions with unsupported functions, you can add the functions to the pxWhitelistfunction data transform or change the strategy logic to contain only supported functions.

Unsupported function in a strategy component

Unsupported function in a strategy component


A strategy component cannot be optimized when it contains functions that are not whitelist functions. The following functions and the functions that are listed in the pxWhitelistFunction data transform are whitelist functions.

Function Ruleset Library Parameters
divide Pega-RULES Math (BigDecimal::dividend, BigDecimal::divisor)
today Pega-RULES DateTime N/A
normal Pega-DecisionEngine Random N/A
normal Pega-DecisionEngine Random (double::mean, double::sd)
random Pega-DecisionEngine Random N/A
random Pega-DecisionEngine Random (double::min, double::max)
and N/A N/A (boolean::param...)
or N/A N/A (boolean::param...)
getDate Pega-RULES DateTime (String::strStamp)
DateTimeDifference Pega-RULES DateTime (String::beginTime, String::endTime, String::strPrecision)
if N/A N/A (boolean::condition, then, otherwise)

The pxWhitelistFunction data transform

Example of a function that can be optimized in globally optimized strategies


Investigate the strategy that you want to optimize and consider changing the strategy's logic. You might need to use different strategy components or reconfigure the existing ones to remove references to the functions that cannot be optimized. Alternatively, it might be possible to add these functions to the pyWhitelistFunction data transform that is applied in the pxWhitelistFunction data transform and enable optimization for the component that uses the functions.

Adding a new whitelist function

  1. In Designer Studio, open and overwrite the pyWhitelistFunction data transform.
  2. In the Action column, select Update Page and specify source values for the following targets:

    • .pyFunctionName

    • .pyLibraryName

    • .pyRuleSetName

    • .pyParameters(<APPEND>)

    Overwriting pyWhitelistFunction data transform

    Adding a function to the pyWhitelistFunction data transform

  3. Save your changes and rerun the globally optimized strategy.
  4. On the Test tab of the optimized strategy, do a side-by-side comparison to see differences between nonoptimized and optimized results.

When you add a function to the pyWhitelistFunction data transform, consider these requirements:

  • The parameters and the return type of the function must be of the following type: String, BigDecimal, java.util.Date, double, Double, int, Integer, Boolean, or boolean.
  • The body of the function cannot contain any Public API.
  • StepPage in the body of the function cannot be modified.
  • Function must not have any side effects.
Suggest Edit

Related Content

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.