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

Updated on March 11, 2021

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.


In Dev Studio, you can verify which components are optimized to decide which functions you want to define as allow list functions on the strategy canvas or on the Global Optimization tab, as shown in the following figures:

Unsupported functions in strategy components
Using the Show optimization feature in a strategy canvas.
Unsupported function in a strategy component
A component status view of a partially optimized strategy containing not optimized components.


A strategy component cannot be optimized when it contains functions that are not on the list of allowed functions. The following functions are allowed:

Functions allowed for optimization

dividePega-RULESMath(BigDecimal::dividend, BigDecimal::divisor)
normalPega-DecisionEngineRandom(double::mean, double::sd)
randomPega-DecisionEngineRandom(double::min, double::max)
DateTimeDifferencePega-RULESDateTime(String::beginTime, String::endTime, String::strPrecision)
ifN/AN/A(boolean::condition, then, otherwise)


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 and enable optimization for the component that uses the functions.

  1. In the navigation pane of Dev Studio, click Records.
  2. Expand the Data Model category, and then click Data Set.
  3. In the list of data transform rules, click pyWhitelistfunction.
  4. On the Definition tab, place the cursor in one of the first-level rows, and then click the Add a row button.
  5. Define the new function:
    1. From the list in the Action column, select Update Page.
    2. In the Target column, enter: pyWhiteListFunction
    3. To propagate values from another page, from the list in the Relation column, select with values from and then enter the page name in the Source column.
    4. Add and fill in the second-level rows with the following properties:
      • .pyFunctionName
      • .pyMethodName
      • .pyLibraryName
      • .pyRuleSetName
      • .pyReturnType
      • .pyParameters
      For more information, see Data Transforms.

    When you add a function to the pyWhitelistFunction data transform, ensure that you comply with the following requirements:

    • Use only the following supported parameters and return types for the new function:
      • String
      • BigDecimal
      • java.util.Date
      • double
      • Double
      • int
      • Integer
      • 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.

    The following image shows a sample configuration of a new allow list function:

    Adding a function to the pyWhitelistFunction data transform
    Configuration of a new allow list function in the pyWhitelistFunction data transform.
  6. Confirm the changes by clicking Save.
  7. Rerun the globally optimized strategy.
  8. On the Test tab of the optimized strategy, do a side-by-side comparison to see differences between non-optimized 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. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us