Skip to main content
Verify the version tags to ensure you are consuming the intended content or, complete the latest version.

Rule reuse through inheritance

Nota: Some interactive elements in this Mission may not work as expected in non‑English versions. These do not impact the learning objectives or Mission completion.

Inheritance allows your application to reuse existing Rules across Case Types and applications, reducing development effort while maintaining consistency and quality. To maximize these benefits, Lead System Architects carefully design the class structure so that commonly used Rules can be defined once and inherited where needed. A well designed class hierarchy helps promote reuse, minimize duplication, and simplify long term maintenance.

Nota: Determine the reusability of a Rule before deciding where it belongs in the class and Ruleset hierarchy.

Pega Platform™ provides two methods for Rule inheritance: pattern inheritance and directed inheritance.

Pattern inheritance

Pattern inheritance is automatic. Pattern inheritance uses the existing class name structure to determine which Rules are available for reuse. Pattern inheritance searches classes that share a class name prefix. Pattern inheritance promotes reuse based on business suitability because Rules are aggregated at higher levels to reflect their usability throughout an entire division or organization. For example, a Rule applied at the division level that defines elements of payment processing for insurance claims can be reused by each claims department belonging to that division.

The following image illustrates a basic pattern inheritance hierarchy for an insurance company (ABCIns) and two of its divisions: Consumer and Business. The ABCIns class is the parent class to two child classes (ABCIns-Consumer and ABCIns-Business) which are themselves the parent classes to ABCIns-Consumer-PolicyProcessing and ABCIns-Business-PolicyProcessing, respectively.

Match the numbers to the following image to learn more about pattern inheritance:

1. Organizational-level SLA The ABCIns class maintains a standard Service-Level Agreement (SLA) Rule, .pyCaseTypeDefault, for all Cases created regardless of the division. A division may make changes to the standard SLA Rule without increasing the deadline. Creating the standard SLA in the organization layer enables reuse by both divisions.

2. Change primary driver The consumer division offers family coverage and requires that a specific primary driver be assigned to each vehicle. Management has observed that families sometimes change primary drivers due to licensing changes among the younger family members. A Case-wide Action to Change primary driver in the ABCIns-Consumer-PolicyProcessing-Work class enables users of all child Case Types of that class to adjust the primary driver if necessary.

3. Change insured vehicle The Business division frequently needs to adjust or change the insured vehicle due to errors that identify which vehicle or vehicles in the fleet is the subject of a quote or claim Case. A Case-wide Action to Change insured vehicle in the ABCIns-Business-PolicyProcessing-Work makes the Rule available for all the child Case Types of the ABCIns-Business-PolicyProcessing-Work class.

 pattern inheritance

Directed inheritance

Directed inheritance is inheritance between classes where the parent class is explicitly specified, unlike pattern inheritance, which is automatic. You apply directed inheritance to reuse standard Pega Platform Rules and Rules from other applications outside the business class hierarchy. You list directed inheritance on the class Rule form. Because Rules are aggregated based on whether they apply to all Cases or Cases of a certain type, directed inheritance promotes reuse based on functional suitability.

For example, a Rule may be limited to a specific implementation, such as an auto insurance application, or applied to all implementations, including applications for property and marine insurance.

Directed inheritance is the option that allows an application class to inherit Rules defined for standard Pega classes, such as the Work- or Data- class.

Nota: Set the Rules in a higher parent class if you anticipate reusing them to avoid duplicate Rules. When creating a new Rule that is similar to an existing Rule, refactor the Rule to use parameters instead of creating multiple versions of the Rule. 

For example, consider an organization named TGB that has an IT application with Ticket Cases and an Accounting application with Purchase Request Cases. Both the Ticket and Purchase Request Case Types use a property, .pxCreateOpName, to record the name of the operator that creates the Case. Through directed inheritance, both Cases inherit the property which is defined in the Work-Cover class.

TGB example showing pattern and directed inheritance

Check your knowledge with the following interaction:

Inheritance and Rule reuse

Pega Platform first searches through the parent classes indicated by pattern inheritance when reusing Rules through inheritance. If unsuccessful, Pega Platform then searches the parent class indicated by directed inheritance as the basis for another pattern inheritance search. This process repeats until the system reaches the last class in the class hierarchy, called the ultimate base class or @baseclass. If the system cannot find the Rule after searching @baseclass, Pega Platform returns an error.

Consider the following example in which an auto insurance claim Case references the field that stores the Case ID. The application containing the auto insurance claim is built on a generic policy administration application. That generic application is built on the Pega Platform.

Match the numbers to the following image to learn more about how Pega Platform searches for the Case ID:

1. Step 1: An auto insurance claim Case, described by the InsCorp-Claims-Work-AutoClaim class, references the Case ID.

2. Step 2: If the Case ID is not found in the InsCorp-Claims-Work-AutoClaim class, Pega Platform searches through the parent classes by using pattern inheritance.

3. Step 3: If the Case ID is not found through pattern inheritance, Pega Platform searches the parent class specified by directed inheritance, InsApp-Claims-Work-Claim. This class belongs to the generic policy administration application. Notice how the InsApp-Claims-Work-Claim class does not have an automatic parent-child relationship (it does not share a class name prefix) with the InsCorp-Claims-Work-AutoClaim class.

4. Step 4: If the Case ID is not found in the InsApp-Claims-Work-Claim class, Pega Platform searches its parent classes by using pattern inheritance.

5. Step 5: If the Case ID is not found through pattern inheritance, Pega Platform searches the parent class specified by directed inheritance, Work-Cover-. This class belongs to Pega Platform.

6. Step 6: If the Case ID is not found in the Work-Cover- class, Pega Platform searches its parent classes by using pattern inheritance.

7. Step 7: If the Case ID is not found in the Work class, Pega Platform searches the ultimate base class specified by directed inheritance, @baseclass. Pega Platform locates the Case ID in @baseclass.

Inheritance and Rule reuse

Check your knowledge with the following interaction:


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Este conteúdo foi útil?

Quer nos ajudar a melhorar esse conteúdo?

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

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice