0% found this document useful (0 votes)
34 views32 pages

Rulesets and Rule Resolution

Uploaded by

balaji babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views32 pages

Rulesets and Rule Resolution

Uploaded by

balaji babu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

PRPC V6.

RuleSet and Rule Resolution

LEVEL – LEARNER
RuleSet and Rule Resolution: Overview

• Introduction:

 A RuleSet is a collection of interrelated rules that define an application.


 An application contains rules that may be distributed across multiple
RuleSets or the same rule instance may be present in multiple RuleSet or
RuleSet versions. Rule Resolution is a sophisticated internal search
mechanism which the Process Commander system uses to find the best and
the most appropriate rule instance to apply in a situation.

2
Objectives

After completing this chapter you will learn:


– Fundamentals of RuleSet
– Standard RuleSets
– How to create RuleSet Name
– What is RuleSet Version
– RuleSet Version
• How to create it
• Locking
• Pre-requisites
– How Rule Resolution works
– Exceptions to Rule Resolution
– Benefits of Rule Resolution
– Types of RuleSet and their role in Rule Resolution

3
Do You Know

• What is a Rule?
• What is Locking?

4
Fundamentals of RuleSet

• RuleSet is a container for related group of Business Rules.


• Every rule type instance in the PegaRULES database ‘belongs’ to a RuleSet.
• RuleSet is an instance of the Rule-RuleSet-Name class.
• Each RuleSet name is associated with one or more instance/s of Rule-RuleSet-
Version
• Utility -
 Access control
 Managing the contents of the rulebase
 Moving applications — sets of rules — from one Process Commander
system to another.

5
Standard RuleSets

• Some standard RuleSet names are provided with a PRPC


installation.
– Pega-ProCom — Standard rules that support business process
management (BPM) applications
– Pega-IntSvcs — Standard rules that support integration
– Pega-WB — Standard rules that support the portal infrastructure
– Pega-RULES — Standard rules that support business rules engine and rule
resolution
Apart from the above four RuleSets there are various other RuleSets which form the foundation
for all PRPC applications. All other RuleSets created during application development to group
interrelated rules are ‘built on top’ of these RuleSets.

In addition, any application developer who can check out rules has a private RuleSet which holds
the temporarily checked out rule. The system creates each private RuleSet automatically, named to
match the developer's Operator ID value.

6
How To Create RuleSet

• While creating a new RuleSet, use a single key which appropriately describes
the group of rules it contains.
• Guidelines
– The following guidelines should be followed while naming a
RuleSet:
• Start the RuleSet name with a letter and use only letters, digits, and
dashes. Choose names that are short and easy to remember.
• Don't choose a name that starts with the four letters Pega, or other
variations of this text with different case. Such RuleSets have special
capabilities and are reserved for use by PegaSystems Inc.
• RuleSet names may be up to 64 characters long, but normally are less
than 20 characters long.
• A RuleSet name must be unique system-wide.

7
How To Create RuleSet Cont…

• In the Rules Explorer, in the SysAdmin category, right-click RuleSet and select
New.

Specify RuleSet Name

The system enters a default


three-part version identifier of
01-01-01. We can modify the
version identifier using
another three-part identifier.

This new RuleSet Version must have at


least one prerequisite. The system enters
the highest Pega-ProcessCommander
version in the system.

8
How To Create RuleSet Cont…

• RuleSet: Versions Tab

• RuleSet: Security Tab Select this check box if you want the rules in
this RuleSet to override, and extend an
application, rather than define an application.
A local customization RuleSet should not be
moved to other Process Commander
Systems.

Select this check box if you want to let


developers check out a rule to modify it.
When a developer checks out a rule, a copy is
placed in a private RuleSet where he or she
can make and test changes without affecting
the original RuleSet.

9
What is RuleSet Version

• A RuleSet Version is an instance of the Rule-RuleSet-Version rule type. It is


referenced with a special syntax consisting of the RuleSet name, colon, and
three two-digit values, known as the major, minor and patch version, in the
format RuleSetName:NN-NN-NN. It is created to identify, store and manage a
set of interrelated subset of rules of an application. Each of the major, minor or
patch versions can range from 01 to 99.
• A RuleSet Version offers the following features:
– It provides a method to identify a 3 level version number for a RuleSet.
– Modifications to rules contained in a RuleSet Version can be prohibited by
locking this RuleSet Version.
– Specify dependant RuleSet Versions which form the foundation for all
rules defined in a particular RuleSet Version
– RuleSet Versions play a crucial role in enforcing security, in rule resolution
processing and in managing and evolving applications.

10
RuleSet Version - How To Create It

• While creating a new RuleSet Version, you need to give 2 keys. The 1st key is
the name of the RuleSet for which this new version is being created. The 2nd
key is the concatenated two digit values of the major, minor and the patch
version. RuleSet Version Form: Each of the major, minor or patch versions can
range from 01 to 99.

RuleSet Version – Major-Minor-Patch (01-01-01)

11
RuleSet Version - Locking

• Lock a RuleSet Version


Select the Lock this Version? check box and give a password to prohibit
addition of new rule instances or modification/deletion of existing rule
instances to this RuleSet Version. The password given here can be used later to
unlock this Version.

• Unlock a RuleSet version


Uncheck the Lock this Version? check box and give the password (the one used
for locking this Version) in the To Unlock this Version field to unlock this
RuleSet Version. Once unlocked, new rule instances can be created, or existing
rule instances can be modified or deleted from this RuleSet Version.

12
RuleSet Version - Pre-requisites

• Enter one or more RuleSet versions on which your RuleSet


version depends, that is, requires as a prerequisite. For example,
if you're creating a RuleSet version for an application that is to use
rules in Pega-ProCom:06-01-25, enter Pega-ProCom:06-01-25.
Enter all three pairs of digits in the version. The system assembles
a complete required RuleSet version list from:
– All RuleSet versions that you list in this field
– All lower-numbered RuleSet versions of this RuleSet
– All RuleSet versions listed in the Requires RuleSet and Versions field for
those RuleSet versions that you list in this field
When developing rules in this RuleSet version, developers can
reference rules in any RuleSet version in the total RuleSet version
list.
13
How Rule Resolution Works

• The Rule Resolution algorithm scans through the PegaRULES database to find
all rule instances matching the name and type of the rule to be executed. This
is followed by various phases of filtering where the system narrows the search
to one rule instance and executes it. The search criteria of each phase is
applied to the result set obtained from the previous phase.

The following sections describe the various phases of Rule Resolution.

• Phase 0 (Purpose) – Match Rule Type and Name


In this phase, the system searches for all rule instances that match the rule
type (such as Rule-Obj-Property for property rules) and a name or key part.

14
How Rule Resolution Works Cont…

• Phase 1 (Product) – Search up the Class Hierarchy

In this stage, the system searches all the rules which contain an Applies To
class as the key part, starting from the lowest level of the class hierarchy that
matches the class key part of the partially specified rule instance, and works up
to the top (the ultimate base class) gathering all the matches on the name as
found. The system considers both Pattern and Direct inheritance to search for
a rule in the class structure with Pattern inheritance taking precedence over
Direct inheritance.

For rules that do not contain an Applies To class as a key part, such as Rule-
HTML-Fragment, every rule with the supplied name (at all levels) is found.

15
How Rule Resolution Works Cont…

• Phase 2 (User) – Filter by RuleSet list and availability

In this phase of the search, the system scans the result set of Phase 1 and
excludes all rules marked as Not Available, Blocked or Withdrawn.
For the remainder, the RuleSet Name and Version associated with the rule
instance are matched against the RuleSet list of the user. Those rule instances
with RuleSet names and versions not matching the RuleSet list of the user are
excluded.

The RuleSet list of a user is defined in the Application rule associated with the
user’s Operator ID. It is possible to restrict the Rule Resolution search for a
user to the exact RuleSet Version. To know more about how the system
assembles the RuleSet list, please refer to the PRPC Help file or PDN.

16
How Rule Resolution Works Cont…

• Phase 3 (Timing) – Filter based on date and time

Some rules, known as time-qualified rules, are in effect only during a specific
time interval. If any of the candidate rule instances produced by Phase 2 above
are time-qualified, the system uses the current system date and time to find
those that are in force. Any others are eliminated.

If two or more time-qualified rules are both candidates at the current time and
date, the system selects the ones with the nearest end date. Of these, if
multiple candidates have the same end date, the system picks the candidate
with the most recent start date.

17
How Rule Resolution Works Cont…

• Phase 4 (Circumstance) – Qualify on Circumstance

If any of the candidate rule instances produced by Phase 3 contain a


circumstance property reference, a user's clipboard value for this property
reference (if defined) is compared against the property value in the rule. If a
match is found, the rule instance is retained for Phase 5 (and the "unqualified"
rule instance with a blank circumstance fields is dropped). If the circumstance
value in the rule does not match the user's clipboard value, the qualified rule
instance is dropped from the candidate set.

18
How Rule Resolution Works Cont…

• Phase 5 (Security) – Enforce Access Roles and Privileges

Phase 5 excludes rules that the user (or requestor process) cannot execute for
security or access control reasons. Every user holds one or more access roles
and optionally one or more privileges (as defined in the Access of Role to
Object via Access Group referenced in the user’s Operator ID). Access of Role
to Object rules for these access roles determine which classes the user with
that rule can operate on, and how.

In addition, flow rules, correspondence rules, and a few other rule types may
contain an associated list of privilege requirements. The requestor process
must have access to one of the privileges before execution can start. Some
rules also reference one or more When condition rules that must all evaluate
to true before the rule can be executed.
19
How Rule Resolution Works Cont…

• Execute the Survivor Rule

If no rule instances survive the above five phases, the user process is notified
of the "no rule found" condition. If only one rule instance survives, it is
selected and executed. If more than one is found, the one lowest in the class
hierarchy — closest to the Applies To class — is performed.

20
Exceptions to Rule Resolution

• A few rule types have instances that are not associated with a
RuleSet and version and no rule resolution processing occurs
when an instance of these classes is needed. For example, access
roles (Rule-Access-Role-Name rule type) must have names that
are unique system-wide.

• Some other rule types do not support circumstance-qualified or


time-qualified processing. Rule types that don't include an
Applies To class as a key part don't use the Phase 1 class hierarchy
lookup described above.

21
Exceptions to Rule Resolution Cont…

• Certain rule types do not come under the purview of the Rule
Resolution algorithm.
– Rule-Access-Deny-Obj
– Rule-Access-Role-Obj
– Rule-Application
– Rule-Connect-BPEL
– Rule-Method
– Rule-Obj-Class
– Rule-RuleSet-Name
– Rule-RuleSet-Version
– Rule-Service-BPEL
– Rule-Template-
– Rule-Utility-Library
22
Benefits of Rule Resolution

• The benefits of Rule Resolution include:


– Rules can be shared across applications and organizations. Sharing and
reuse is a major benefit of object oriented software.
– Rules defined at a higher level can be overridden by more specific rules
defined at a lower level. While this dilutes the sharing benefit, it provides
often needed flexibility while bringing visibility to exceptions.
– Rules can have multiple versions, even within one RuleSet, and security
rules control which users see and execute which versions. This facilitates
application evolution, testing, and patching.
– One Process Commander system can host multiple applications, multiple
organizations, and multiple versions of one application with minimal
concern for conflicts and interference.
– Applications can be developed independently from other applications, yet
all can depend on common rules that are locked (and so won't change).

23
Types of RuleSet and their role in Rule Resolution

• Application RuleSet - Associated with an application rule and are usually


locked so that the rules they comprise cannot be updated or changed. The
Application rule form lists RuleSets in order based on their prerequisites.
• Production RuleSet - Associated with access groups are unlocked so that
modifications can be made to an application while it is running on a production
system.
• Component RuleSet - Encapsulate functional or capabilities that
operate on embedded pages only. It is designed and intended for reuse in
multiple systems and applications.
• Shared RuleSet - These are designed for reuse that operates on common
top-level pages only so that common functions can be shared among unrelated
applications.

24
Types of RuleSet and their role in Rule Resolution

• If the main Application rule specifies a RuleSet which is also


contained in the prerequisite application, then the definition
specified in the main application supersede the information
in the prerequisite – even if the RuleSet in the prerequisite
application is a higher version than the RuleSet in the main
application.
• Suppose if the main application includes 5 RuleSets and
prerequisites includes 2 RuleSets, then Application RuleSets
would include all the 7 RuleSets. If any RuleSet in the
prerequisites have higher version then it would be
overridden by the main application.
25
Learn How - Demonstration

Demo creation of new RuleSet and versions

26
Questions

27
Welcome Break

28
Lend a Hand

1. Create a RuleSet and RuleSet version.


2. Add the RuleSet in an Application rule.
3. Create any new rule under the newly created RuleSet and
RuleSet version.

29
Test Your Understanding

• What are RuleSet and how are they different from RuleSet
versions ?
• RuleSet version is an instance of which class ?
• What are the different categories for each RuleSet?

30
Summary

• RuleSets are mainly used to identify, store, and manage the


set of rules that define an application.
• RuleSets versions help the system to search for rules during
rule resolution.
• Rule resolution is the internal process by which Process
Commander decides at runtime which rule to execute.

31
PRPC V6.1

You have successfully completed -


RuleSet and Rule Resolution

You might also like