Unit testing individual rules

An incorrect rule configuration in an application can cause delays in case processing. To avoid configuration errors such as incorrectly routed assignments, unit test individual rules as you develop them.

To unit test a rule, open the rule form and select Actions > Run. For some rule types, such as binary file rules, Pega does not provide an option for unit testing. If the rule cannot be unit tested, the Run option does not appear in the Actions menu. The appearance of the Run Rule window varies across rule types, so how you run a rule varies by its type.

In general, you complete the following tasks:

  • Specify whether to create a test page, or, if any pages of the appropriate class already exist on the clipboard, to copy one.
  • Select a data transform to use when Pega Platform creates a test page.
  • For services, specify whether the service rule is to run in your session or as a newly created service requestor. If the service is configured to run as an authenticated user, you are prompted for a user name and password.
  • Provide test data to use when the rule runs.

When you run the rule, the system uses rule resolution. If you click the Run button and there is a higher version of the rule, the system displays a status message stating it will run the higher version.

To test a circumstance rule, ensure that the circumstances are correct for the rule. Otherwise, the base rule is run.