Professional Documents
Culture Documents
This document may include references to Pegasystems product features that have
not been licensed by your company. If you have questions about whether a
particular capability is included in your installation, please consult your
Pegasystems service consultant.
For Pegasystems trademarks and registered trademarks, all rights reserved. Other
brand or product names are trademarks of their respective holders.
Scenario 2............................................................................................ 12
Scenario 2............................................................................................ 19
Scenario 3............................................................................................ 23
Scenario 4............................................................................................ 25
Understanding Inheritance in Rule
Resolution for Process Commander
Applications
This document is not an in-depth exploration of Rule Resolution itself, but an explanation
of how the concept of class inheritance is used in a Process Commander system to
facilitate Rule Resolution.
The ability of a particular rule type (Activity, etc.) to be rule-resolved is dependent upon the
definition of that rule, as shown by the Class form.
Important: Not all rules are rule-resolved; Rule Resolution must be enabled on the class
definition.
CONFIDENTIAL 1
Overview of Rule Resolution
When classes are defined, different features are enabled which affect inheritance and rule
resolution. These features are contained in two sections on the Class form:
This section of the class form enables rule resolution for the rule. The different
checkboxes control different functionality for resoution.
Allow multiple versions with the same key values (Rule Resolution)
This is the most important choice for Rule Resolution, as it enables or disables the
functionality. If this box is not checked, then none of the other checkboxes will appear on
the class form.
If checked, this field allows more than one rule with the same name and class to be
present in the system. When this box is checked, the following Rule qualifiers will be
enabled (i.e., Rule Resolution is used):
2 CONFIDENTIAL
Overview of Rule Resolution
Therefore, if this box is checked, Rule Resolution will be used to open instances of this
class.
NOTE: It is possible for Rules to have this box checked and not have the Use class-
based inheritance to arrive at the correct rule to execute box checked, as they operate
independently. If only Allow multiple versions with the same key values is checked, then
Rules (such as Rule-Message) are allowed to be saved and modified in different
RuleSets/Versions; users will only use one of the same-named objects, based on their
own Profile of RuleSets and Versions.
This checkbox allows the rule to be Circumstance-qualified. If this box is not checked,
Circumstances and Circumstance Dates may not be used with this rule. (For example,
Declarative rules may not use Circumstances, and this feature is missing from those
rules.)
NOTE: If the Allow multiple versions with the same key values box is not checked, then
this choice is not valid.
Allow rules that are only valid for a certain period of time (Date Range Availability)
This checkbox allows the rule to be qualified by a Date Range. If this box is not checked,
then a Date Range is not valid for this rule. (Declarative rules also may not use Date
Ranges.)
NOTE: If the Allow multiple versions with the same key values box is not checked, then
this choice is not valid.
This field defines how inheritance (through the class hierarchy) affects this rule. For rules
which are defined on other rules (such as Activities), this checkbox will affect how rule
resolution searches for rules in the system. (Details on the functionality enabled by this
checkbox are in the next section.)
CONFIDENTIAL 3
Overview of Rule Resolution
There are some types of rules, like Activities, Models, Whens, Decision Tables, etc., which
may be “applied to” or “defined on” other classes.
In the above example, the activity DisplayFlowAction is defined on the class Work-.
Other rules, such as Rule-Method, do not have the Use class-based inheritance box
checked.
Instances of this rule will not be defined on any classes, and will not have the “Applies To”
field on its instances.
4 CONFIDENTIAL
Inheritance
Inheritance
For rules such as activities which are defined on classes, inheritance applies.
When a particular activity (or property or other such rule) is called during processing, the
application will search for that rule in the class where it was called. If the rule is not
present in that class, Process Commander will search other classes, based on specific
procedures. This section describes the paradigm used to search the class hierarchy
during rule resolution.
In PegaRULES, each class that is defined in the system may have one or two parents,
depending upon the type of inheritance specified:
• pattern inheritance
• directed inheritance
Note that directed inheritance always applies, whether pattern inheritance is enabled or
not.
The Class Inheritance section of the class form defines the class hierarchy and
inheritance for this class, which is then used when determining what rule to use in Rule
Resolution.
CONFIDENTIAL 5
Inheritance
Find by name first (Pattern) – determines pattern inheritance. If this box is checked,
then when the system is searching for a particular rule defined on this class, it will use
pattern inheritance to search through all the classes linked in the hierarchy.
Parent class to inherit from (Directed) – determines directed inheritance. This field
holds the immediate parent, by directed inheritance, to use for this class.
Pattern Inheritance
Pattern inheritance follows the pattern of the names & dashes in the class name to define
inheritance. For example, the class YourCo-CustService-Data-Lender might have the
following ancestors in the class hierarchy:
YourCo-CustService-Data –
YourCo-CustService-Data
YourCo-CustService-
YourCo-CustService
YourCo-
YourCo
If pattern inheritance is being followed, then all Activities, Whens, Models, etc. that are
defined on any of the above classes would be available to be applied to YourCo-
CustService-Data-Lender (unless there is another more specific version of the instance
defined on the YourCo-CustService-Data-Lender class itself).
Pattern inheritance is always checked first. Note that pattern inheritance will cause the
system to search all the way through the class pattern hierarchy before checking directed
inheritance.
It is possible to independently change the definition of Display in any or all of these other
classes, and then, depending upon Rule Resolution - what circumstances are present and
what rules are being used at the time - different versions of Display will be selected by
the system. Rule Resolution will search for the activity Display, and choose the Display
which is defined on the class closest (in the inheritance path) to the one that is being
requested.
Directed Inheritance
Directed inheritance allows the user to specify or direct from what classes the current
class may inherit. Directed inheritance classes do not have to have the same name as
the current class.
A directed inheritance class is required for each class being defined. The field will default
to the pattern class parent; the developer then may change this if they wish.
By default, all base classes (Work-, Data-, etc.) will have directed inheritance to
@baseclass.
6 CONFIDENTIAL
Inheritance
Important: The system will not prevent users from creating classes with
inheritance that is circular, although this is definitely NOT PegaRULES
Best Practice. If this kind of circular inheritance does happen, however,
the system knows to go through a class only once.
Example:
If Pattern inheritance is enabled, rule resolution will follow a name pattern all the way up
through the pattern hierarchy, no matter what the inheritance settings are for classes
higher in the pattern hierarchy.
Directed inheritance is evaluated on a class-by-class basis, and only one link is followed at
a time. Although pattern inheritance allows the system to search through an entire chain
of classes, directed inheritance will only search to the specified directed inheritance class,
and then stop and evaluate the next place to search, depending upon the definition of that
class.
Thus, for the class defined above (PegaSample-Folder), if searching for a specific rule
(“Display”) defined on that class, the system would check the current class, and then
follow pattern inheritance to PegaSample. If the activity were not found there, the system
would follow the directed inheritance link and check Work-Folder-, and then, depending
upon the settings in Work-Folder-, follow either pattern or directed inheritance from there.
1
For almost every class, Pattern inheritance should remain enabled (checked). A possible
exception might be a situation where the hierarchy was built incorrectly, and now inheritance must be
forced into a certain path.
CONFIDENTIAL 7
Inheritance
YourCo-
YourCo-CustService
YourCo-CustService-CustCall
YourCo-CustService-CustCall-Lender
Data-
Data-Party
Work-
@baseclass
@baseclass
Directed
(defaulted)
YourCo- Directed
(defaulted) Directed
(defaulted)
Pattern
YourCo-
CustService
Work-
Data-
Pattern
Directed
YourCo-
CustService-
CustCall- Pattern Directed
Data-Party
Pattern
YourCo- Directed
CustService-
CustCall-
Lender
8 CONFIDENTIAL
Inheritance
Inheritance is set up for the above diagram by checking inheritance boxes on Class forms:
On Class Form:
Find by Name Pattern First Inherit From (Parent)
checked (pattern field entry (directed
Class inheritance) inheritance)
Most Immediate Ancestor: Most Immediate
Ancestor:
YourCo- @baseclass*
Data- @baseclass*
Work- @baseclass*
*As stated previously, all classes are assumed to have directed inheritance to
@baseclass; if there is not a specific class chosen for directed inheritance, @baseclass
should be used..
In the above setup, the user wishes to use the Activity Display. There are several paths
that rule resolution for this Activity could take, depending upon what inheritance options
are chosen.
CONFIDENTIAL 9
Inheritance
Scenario 1
If the class being requested is YourCo-CustService-CustCall-Lender, and the pattern and
direct inheritance for this class both point to YourCo-CustService-CustCall (and pattern
inheritance is enabled for all of these classes), the system will search for Display in the
following order:
1. YourCo-CustService-CustCall-Lender
2. YourCo-CustService-CustCall
3. YourCo-CustService
4. YourCo-
5. Work-
6. @baseclass
10 CONFIDENTIAL
Inheritance
As stated above, all classes end with directed inheritance to @baseclass, so after
checking YourCo- and then following directed inheritance from YourCo-CustService-
CustCall up through Work-, the last class checked in this pattern is @baseclass.
All the above rules in any available RuleSet and Version will be selected to begin Rule
Resolution.
CONFIDENTIAL 11
Inheritance
Scenario 2
NOTE: The example has changed slightly for this scenario – as part of the application
development, the developer has changed directed inheritance for the class YourCo-
CustService-CustCall-Lender to point to Data-Party.
In this scenario, due to this change, the first directed link becomes the one from YourCo-
CustService-CustCall-Lender, up to Data-Party. This link will be followed after all the
classes were checked using pattern inheritance. Therefore, the system will search for
Display in the following order:
1. YourCo-CustService-CustCall- 5. Data-Party
Lender 6. Data-
2. YourCo-CustService-CustCall 7. @baseclass
3. YourCo-CustService
4. YourCo-
12 CONFIDENTIAL
Inheritance
Realize that inheritance can be changed by adding new classes. In the first scenario, the
system is looking for the Activity Display and may find it in the Work- class. However, if
another class is added later which is located lower in the chain (such as Data-Party, which
is then the directed link), then that class will be used for directed inheritance, and Work-
will not be checked.
CONFIDENTIAL 13
Additional Inheritance Examples
YourCo-
YourCo-CustService
YourCo-CustService-Data
YourCo-CustService-Data-Lender
YourCo-CustService-Data-Lender-InvestmentBank
YourCo-CustService-Data-Party
Data-
Data-Party
14 CONFIDENTIAL
Additional Inheritance Examples
@baseclass
Directed
(defaulted)
Directed
YourCo- (defaulted)
Pattern
YourCo-
Data-
CustService
Directed
Directed Pattern
Pattern
YourCo- Data-Party
CustService-
Data-
Pattern
Directed
YourCo-
CustService-
Pattern Data-Party
YourCo-
Directed
CustService-
Data-Lender
Pattern
Directed
YourCo-CustService-
Data-Lender-
InvestmentBank
CONFIDENTIAL 15
Additional Inheritance Examples
Inheritance is set up for the above diagram by checking inheritance boxes on Class forms:
On Class Form:
Find by Name Pattern First Inherit From (Parent)
checked (pattern field entry (directed
Class inheritance) inheritance)
Most Immediate Ancestor: Most Immediate
Ancestor:
YourCo-CustService-Data- YourCo-CustService-Data- YourCo-CustService-
Lender-InvestmentBank Lender Data-Lender
YourCo-CustService-Data- YourCo-CustService-Data YourCo-CustService-
Lender Data-Party
YourCo-CustService-Data YourCo-CustService Data-
YourCo-CustService YourCo- @baseclass*
YourCo- @baseclass @baseclass*
YourCo-CustService-Data- YourCo-CustService-Data Data-Party
Party
Data-Party Data- Data-
Data- @baseclass*
*As stated previously, all classes are assumed to have directed inheritance to
@baseclass; if there is not a specific class chosen for directed inheritance, @baseclass
should be used..
In the above setup, the user wishes to use the Activity Display. There are several paths
that rule resolution for this Activity could take, depending upon what inheritance options
are chosen.
16 CONFIDENTIAL
Additional Inheritance Examples
Scenario 1
If the class being requested is YourCo-CustService-Data-Lender-InvestmentBank, and
pattern inheritance is enabled for all of these classes, the system will search for Display in
the following order:
1. YourCo-CustService-Data-Lender- 5. YourCo-
InvestmentBank 6. YourCo-CustService-Data-Party
2. YourCo-CustService-Data-Lender 7. Data-Party
3. YourCo-CustService-Data 8. Data-
4. YourCo-CustService 9. @baseclass
KEY:
Name Pattern - YES means that the
field Find by Name Pattern First was
9 checked, and Pattern Inheritance is
@baseclass
enabled.
Name Pattern - NO means that the field
YourCo- Find by Name Pattern First was
5 Name Pattern - YES
Directed unchecked, and Pattern Inheritance is
Inherit From: @baseclass
(defaulted) disabled.
Pattern
Data-
YourCo-CustService
8 Name Pattern - YES
Inherit From: @baseclass
4 Name Pattern - YES
Inherit From: YourCo-
Pattern
Pattern
Data-Party
YourCo-CustService- 7 Name Pattern - YES
3 Data Inherit From: Data-
Name Pattern - YES
Inherit From: Data-
Directed
YourCo-CustService-
Pattern 6 Data-Party
Name Pattern - YES
Inherit From: Data-Party
YourCo-CustService-
Data-Lender Directed
2 Name Pattern - YES
Inherit From: YourCo-
CustService-Data-Party
Pattern
YourCo-CustService-Data-
Lender-InvestmentBank
1 Name Pattern - YES
Inherit From: YourCo-
CustService-Data-Lender
CONFIDENTIAL 17
Additional Inheritance Examples
All the above rules in any available RuleSet and Version will be selected to begin Rule
Resolution.
Important: Most Rule Resolution points to the class closest (in the inheritance path) to
the one that is being requested (YourCo-CustService-Data-Lender) before checking the
more general class (YourCo-), but depending upon the path that the inheritance searching
follows, the fact that an item is defined in a more specific class does not mean it will
automatically be chosen: as soon as the system finds a match for the rule it is searching
for, it ends the search. (In the example above, if the Activity Display were defined in class
Data-Party and then defined differently in class Data-, Rule Resolution would use the
Display that was defined on class Data-Party and stop.)
Note that although there is a directed link to Data- from YourCo-CustService-Data-, this
directed link is not followed in the scenario. Since YourCo-CustService-Data-Lender
has a directed link to YourCo-CustService-Data-Party, and is closer to the starting class
of YourCo-CustService-Data-Lender-InvestmentBank, that first directed inheritance
link is followed, and no other directed link off the main Pattern Inheritance chain is
followed.
18 CONFIDENTIAL
Additional Inheritance Examples
Scenario 2
NOTE: The example has changed slightly for this scenario - YourCo-CustService-Data-
Party and Data-Party were removed.
In this scenario, the first directed link becomes the one from YourCo-CustService-Data-,
up to Data-CustService. This link will be followed after all the classes were checked
using pattern inheritance, even though it is not at the bottom of the “pattern chain.”
Therefore, the system will search for Display in the following order:
1. YourCo-CustService-Data- 4. YourCo-CustService
Lender-InvestmentBank 5. YourCo-
2. YourCo-CustService-Data- 6. Data-CustService
Lender 7. @baseclass
3. YourCo-CustService-Data
CONFIDENTIAL 19
Additional Inheritance Examples
KEY:
Name Pattern - YES means that the
field Find by Name Pattern First was
checked, and Pattern Inheritance is
7 @baseclass
enabled.
Name Pattern - NO means that the field
YourCo- Find by Name Pattern First was
5 Name Pattern - YES
Directed unchecked, and Pattern Inheritance is
Inherit From: @baseclass
(defaulted) disabled.
Pattern
Data-CustService
YourCo-CustService
6 Name Pattern - YES
Inherit From: @baseclass
4 Name Pattern - YES
Inherit From: YourCo-
Pattern
Directed
YourCo-CustService-Data
3 Name Pattern - YES
Inherit From: Data-CustService
Pattern
YourCo-CustService-
Data-Lender
2 Name Pattern - YES
Inherit From: YourCo-
CustService-Data
Pattern
YourCo-CustService-Data-
Lender-InvestmentBank
1 Name Pattern - YES
Inherit From: YourCo-
CustService-Data-Lender
20 CONFIDENTIAL
Additional Inheritance Examples
Realize that inheritance can be changed by adding new classes. In the above scenario,
the system is looking for the Activity Display and may find it in the Data-CustService
class. However, if another class is added later which is located lower in the chain, then
that class will be used for directed inheritance, and Data-CustService will not be checked.
In the below example, the class YourCo-CustService-Data-Party has been added to the
system, and the class YourCo-CustService-Data-Lender now has directed inheritance
to that class.
1. YourCo-CustService-Data-
Lender-InvestmentBank
2. YourCo-CustService-Data-
Lender
3. YourCo-CustService-Data
4. YourCo-CustService
5. YourCo-
6. YourCo-CustService-Data-
Party
7. Data-Party
8. Data-
9. @baseclass
CONFIDENTIAL 21
Additional Inheritance Examples
If the required version of Display is defined on Data-CustService, the system may not
find that version. The class Data-CustService is blocked by Data-Party.
KEY:
Name Pattern - YES means that the
field Find by Name Pattern First was
checked, and Pattern Inheritance is
9 @baseclass
enabled.
Name Pattern - NO means that the field
YourCo- Find by Name Pattern First was
5 Name Pattern - YES
unchecked, and Pattern Inheritance is
Inherit From: @baseclass
disabled.
Directed
(defaulted)
Pattern
YourCo-CustService Data-
4 Name Pattern - YES 8 Name Pattern - YES
Inherit From: YourCo- Data-CustService Inherit From: @baseclass
Name Pattern - YES
Inherit From: @baseclass
Pattern
Pattern
Data-Party
7 Name Pattern - YES
Inherit From: Data-
YourCo-CustService-Data
3 Name Pattern - YES
Inherit From: Data-CustService
Directed
YourCo-CustService-
6 Data-Party
Pattern Name Pattern - YES
Inherit From: Data-Party
YourCo-CustService-
Data-Lender Directed
2 Name Pattern - YES
Inherit From: YourCo-
CustService-Data-Party
Pattern
YourCo-CustService-Data-
Lender-InvestmentBank
1 Name Pattern - YES
Inherit From: YourCo-
CustService-Data-Lender
The above scenarios assume that Pattern Inheritance is enabled for all the above classes.
There are a number of different inheritance paths that could be followed through this
system, based on what settings are chosen in each class.
22 CONFIDENTIAL
Additional Inheritance Examples
Scenario 3
Because pattern inheritance will cause the system to search all the way through the
hierarchy before checking directed inheritance, if Find by Name Pattern First? were
checked (pattern inheritance enabled) for YourCo-CustService-Data-Lender-
InvestmentBank, then then the path through the list of rules searched for Display would
remain the same as Scenario 1, even if Find by Name Pattern First? were unchecked
(pattern inheritance disabled) for other classes (YourCo-CustService-Data-Lender,
YourCo-CustService-Data, YourCo-CustService, YourCo-).
1. YourCo-CustService-Data-Lender-InvestmentBank
2. YourCo-CustService-Data-Lender
3. YourCo-CustService-Data
4. YourCo-CustService
5. YourCo-
6. YourCo-CustService-Data-Party
7. Data-Party
8. Data-
9. @baseclass
CONFIDENTIAL 23
Additional Inheritance Examples
KEY:
Name Pattern - YES means that the
field Find by Name Pattern First was
9 checked, and Pattern Inheritance is
@baseclass
enabled.
Name Pattern - NO means that the field
Find by Name Pattern First was
YourCo-
5 Name Pattern - NO
Directed unchecked, and Pattern Inheritance is
(defaulted) disabled.
Inherit From: @baseclass
Pattern
Data-
YourCo-CustService
8 Name Pattern - YES
Inherit From: @baseclass
4 Name Pattern - NO
Inherit From: YourCo-
Pattern
Pattern
Data-Party
YourCo-CustService- 7 Name Pattern - YES
3 Data Inherit From: Data-
Name Pattern - NO
Inherit From: Data-
Directed
YourCo-CustService-
Pattern 6 Data-Party
Name Pattern - YES
Inherit From: Data-Party
YourCo-CustService-
Data-Lender Directed
2 Name Pattern - NO
Inherit From: YourCo-
CustService-Data-Party
Pattern
YourCo-CustService-Data-
Lender-InvestmentBank
1 Name Pattern - YES
Inherit From: YourCo-
CustService-Data-Lender
24 CONFIDENTIAL
Additional Inheritance Examples
Scenario 4
If Find by Name Pattern First? were unchecked (pattern inheritance disabled) for
YourCo-CustService-Data-Lender-InvestmentBank, the system would then follow directed
inheritance to YourCo-CustService-Data-Lender. Since checking is done on a class-by-
class basis for directed inheritance, the inheritance path would then be determined by the
settings in YourCo-CustService-Data-Lender. If Find by Name Pattern First? were
checked in YourCo-CustService-Data-Lender, then the path for inheritance for YourCo-
CustService-Data-Lender-InvestmentBank would be the same as Scenario 1:
1. YourCo-CustService-Data-Lender-InvestmentBank
2. YourCo-CustService-Data-Lender
3. YourCo-CustService-Data
4. YourCo-CustService
5. YourCo-
6. YourCo-CustService-Data-Party
7. Data-Party
8. Data-
9. @baseclass
CONFIDENTIAL 25
Additional Inheritance Examples
KEY:
Name Pattern - YES means that the
field Find by Name Pattern First was
9 checked, and Pattern Inheritance is
@baseclass
enabled.
Name Pattern - NO means that the field
Find by Name Pattern First was
YourCo- Directed unchecked, and Pattern Inheritance is
5 Name Pattern - YES (defaulted) disabled.
Inherit From: @baseclass
Pattern
Data-
YourCo-CustService
8 Name Pattern - YES
Inherit From: @baseclass
4 Name Pattern - YES
Inherit From: YourCo-
Pattern
Pattern
Data-Party
YourCo-CustService- 7 Name Pattern - YES
3 Data Inherit From: Data-
Name Pattern - YES
Inherit From: Data-
Directed
YourCo-CustService-
Pattern 6 Data-Party
Name Pattern - YES
Inherit From: Data-Party
YourCo-CustService-
Data-Lender Directed
2 Name Pattern - YES
Inherit From: YourCo-
CustService-Data-Party
Directed
YourCo-CustService-Data-
Lender-InvestmentBank
Name Pattern - NO
1 Inherit From: YourCo-
CustService-Data-Lender
26 CONFIDENTIAL
Additional Inheritance Examples
1. YourCo-CustService-Data-Lender-InvestmentBank
2. YourCo-CustService-Data-Lender
3. YourCo-CustService-Data-Party
4. Data-Party
5. Data-
6. @baseclass
KEY:
Name Pattern - YES means that the
field Find by Name Pattern First was
6 @baseclass checked, and Pattern Inheritance is
enabled.
Name Pattern - NO means that the field
Find by Name Pattern First was
unchecked, and Pattern Inheritance is
Directed
disabled.
(defaulted)
YourCo-
Name Pattern - NO
Inherit From: @baseclass Data-
5 Name Pattern - NO
Inherit From: @baseclass
YourCo-CustService
Directed
Name Pattern - NO
Inherit From: YourCo-
Data-Party
4 Name Pattern - NO
YourCo-CustService- Inherit From: Data-
Data
Name Pattern - NO
Inherit From: Data- Directed
YourCo-CustService-
3 Data-Party
Name Pattern - NO
Inherit From: Data-Party
YourCo-CustService-
Directed
Data-Lender
2 Name Pattern - NO
Inherit From: YourCo-
CustService-Data-Party
YourCo-CustService-Data-
Directed Lender-InvestmentBank
Name Pattern - NO
1 Inherit From: YourCo-
CustService-Data-Lender
CONFIDENTIAL 27
Additional Inheritance Examples
28 CONFIDENTIAL