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.

How to refactor class-based rules into a new Applies To class or RuleSet Version

Updated on September 10, 2021

Summary

You can use the Refactor Rules tool to move rules to a different Applies To class, RuleSet, or RuleSet version. After selecting the class in your Application Explorer, you specify the new class, RuleSet, and RuleSet version, and the individual rules you want to move. The rules are saved to the target class and removed from the original class.

For example, if the work class MyCo-Mortgage-West- has 200 applicable rules   — 200 rules which apply to that class — in RuleSet version MyCo:03-04-07, you can move them all into class YourCo-Mortgage-East- and RuleSet version YourCo:01-01-01 with this tool.

 

Suggested Approach

Prerequisites

Note these prerequisites and limitations:

  • The RuleSet version or versions currently containing the rules to be copied must not be locked
  • Rules that are checked out are not moved
  • The class must allow rules in the target RuleSet
  • Only rules that have an Applies To key part matching the single source class are moved. Rules with no Applies To key part are not affected by this tool
  • The rule to be moved must not have the same class, other keys, and RuleSet Version as an existing rule

Starting the tool

From the Application Explorer, right-click on the class that contains the rules. Select Refactor from the context menu.

The Refactor Rules page displays.

You use this page to specify the criteria for the refactoring, and to select the rules you want to move.

Completing the Refactor Rules tool

    1. Use the Move items to ...dropdown to select the destination class.

       

      The class you select becomes the Applies To class for the rules after they are moved.

    2. Use the Same them into RuleSet . . . dropdown to select the RuleSet to contain the rules after they are moved.
    3. Use the Version dropdown to select the version of the selected RuleSet for the refactored rules.
    4. From the list of applicable rules, select the checkbox next to each rule that you want to refactor or select the checkbox at the top of the column next to Rule Type to select all the rules.
    5. When your criteria are correct, click Save As to begin the refactoring. The rules are saved to the target class and removed from the original class.

When the process completes, the status of each rule will be displayed.

A check mark indicates success, and an 'X' indicates an error. Hover over the error status to display a tool-tip describing the problem.

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