Table of Contents

Configuring a custom control by using the rule form

When you see the message "Unregistered request encountered" in the security alert log, you need to fix the behavior of the non-autogenerated control that invokes the specified rule. There are various ways to prevent this alert from being logged - register the action or encrypt the URL. Use the rule form when a control such as a button calls the Run Script action, which in turn calls a custom function. This rule form configures registration of the custom rules that are invoked from the custom function.

For example, a button calls the Run Script action, which calls the setStockPrice function. This function runs the data transform setStockPriceDT. In the rule form, you register setStockPriceDT.

Defining an action

To define the action:

  1. On the Action tab for the button, click Add an action.
  2. Click All actions, and then click Run script.
  3. In the Function Name field, enter setStockPrice.

Registering the data transform and prevent the security alert

To register the data transform and prevent the security alert:

  1. Select the Configure OOTB actions used in run script check box.
  2. Click Add an action.
  3. Select the Run data transform action.
  4. In the Data Transform field, enter setStockPriceDT.
  5. Click Submit.
Note: Your function might call numerous rules or rules other than a data transform. Steps 6 and 7 in the preceding example procedure will be different when you configure your non-autogenerated control with your custom function.
Configuring the control by using the rule form
"Run Script action dialog box"
Configuring the control by using the rule form

Submitting the action request content in encrypted form

An alternate to registering the data transform is to encrypt the submitted action request content. The developer can write code in a non-auto section or html fragment and include it in the harness.

To ensure the action request content is submitted in encrypted form:

  1. Use the rule utility function pega_rules_utilities.pzEncryptURLActionString to encrypt the action. This function requires parameters in the following format: pega_rules_utilities.pzEncryptURLActionString(tools, "Thread",pyActivity=activityName&param1=value1&param2=value2")
    For example: pega_rules_utilities.pzEncryptURLActionString(tools, "Thread", pyActivity=pzRunActionWrapper&pzDataTransform=setStockPriceDT")
  2. Enter a code snippet. An example of a specific and generic code snippet is shown below:
    • generic code snippet: pega_rules_utilities.pzEncryptURLActionString(tools, "Thread", "pyActivity=activityName&param1=value1&param2=value2")
    • specific code snippet: pega_rules_utilities.pzEncryptURLActionString(tools, "Thread", "pyActivity=pzRunActionWrapper&pzDataTransform=setStockPriceDT")
  3. Click Save.

An example of this can be found in the baseclass.SpellCheckerMoreDialog rule:

Rule name: @baseclass.SpellCheckerMoreDialog
Rule name: @baseclass.SpellCheckerMoreDialog
Suggest Edit

Have a question? Get answers now.

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