Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Optimizing strategies with allow list functions in Pega 7.4

Updated on July 6, 2020

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 pyWhitelistfunction data transform or change the strategy logic to contain only supported functions.

Unsupported function in a strategy component

Unsupported function in a strategy component

Cause

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

For an example of a function that can be optimized in globally optimized strategies, see the figure in Adding a new allow list function.

FunctionRulesetLibraryParameters
dividePega-RULESMath(BigDecimal::dividend, BigDecimal::divisor)
todayPega-RULESDateTimeN/A
normalPega-DecisionEngineRandomN/A
normalPega-DecisionEngineRandom(double::mean, double::sd)
randomPega-DecisionEngineRandomN/A
randomPega-DecisionEngineRandom(double::min, double::max)
andN/AN/A(boolean::param...)
orN/AN/A(boolean::param...)
getDatePega-RULESDateTime(String::strStamp)
DateTimeDifferencePega-RULESDateTime(String::beginTime, String::endTime, String::strPrecision)
ifN/AN/A(boolean::condition, then, otherwise)

Solution

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 allow list function

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

  • Use only the following supported parameters and return types for the new function:
    • “java.lang.String”
    • “java.math.BigDecimal”
    • “java.util.Date”
    • “double”
    • “java.lang.Double”
    • “int”
    • “java.lang.Integer”
    • “java.lang.Boolean”
    • “boolean”
  • Do not embed any public APIs in the function body.
  • Do not modify the StepPage in the function body.
  • Ensure that the function does not have any side effects.
  • Enclose Source column values with double quotes.
  1. In the navigation panel of Designer Studio, click Records.
  2. Expand the Data Model section and click Data Transform.
  3. In the list of data transform rules, click pyWhitelistFunction.
  4. On the Definition tab, in the Action column, select Update Page, and then specify source values for the following targets, as shown in the following figure:
    1. .pyFunctionName
    2. .pyMethodName
    3. .pyLibraryName
    4. .pyRuleSetName
    5. .pyReturnType
    6. .pyParameters(<APPEND>)
    "Media does not display"
    Adding a function to the pyWhitelistFunction data transform
  5. Save your changes and rerun the globally optimized strategy.
  6. On the Test tab of the optimized strategy, do a side-by-side comparison to see differences between nonoptimized and optimized results.

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us