Rule instances in the Pega 7 Platform database are heavily indexed to speed the searching operations used in rule resolution.
The pzInsKey value for many types of rules is formed by concatenating the values of several properties:
For example, the pzInsKey value for the standard property Work-.pyStatusWork is:
RULE-OBJ-PROPERTY WORK- PYSTATUSWORK #20040927T235233.165 GMT
The ruleset and version are not part of this value. Rules with the same name (same visible key parts) in different rulesets or versions have a different creation date and time.
The pr4_rule_property
table contains property rules (Rule-Obj-Property rule type) and property qualifier rules (Rule-Obj-Property-Qualifier rule type).
Item |
Description |
Database table |
|
pzInsKey elements |
pxObjClass pyClassName pyPropertyName pxCreateDateTime |
Rows |
Standard properties plus properties in your application rulesets. |
Indexes |
Using multiple indexes, properties can be selected by Applies To class (pyClassName), ruleset, ruleset version, and visible key (pxInsName). |
For example, the pzInsKey value for the property PegaSample.pyDueBy is:
RULE-OBJ-PROPERTY PEGASAMPLE PYDUEBY #20040927T235125.886 GMT
The pr4_rule_flow
table contains flows (Rule-Obj-Flow rule type).
Item |
Description |
Database table |
|
pzInsKey elements |
pxObjClass pyClassName pyFlowName pxCreateDateTime |
Rows |
Standard flows, plus flows in your application rulesets. |
Indexes |
Using multiple indexes, flows can be selected by Applies To class (pyClassName), ruleset, ruleset version, and visible key (pxInsName). |
For example, the pzInsKey value for the property Work-.StandardBasicWork is:
RULE-OBJ-FLOW WORK- STANDARDBASICWORK #20050922T182708.044 GMT
For each flow, the system saves a JPG image of the Process Modeler diagram in a binary file rule (Rule-File-Binary rule type).
The pr4_rule_requirement
table contains application requirements (Rule-Application-Requirement rule type).
Item |
Description |
Database table |
|
pzInsKey elements |
pxObjClass pxInsName pxCreateDateTime |
Rows |
Application requirements. |
Indexes |
Using multiple indexes, requirements can be selected by their class (pxObjClass) and visible key (pxInsName). |
For example, the pzInsKey value for the requirement OrderFW.OrderNumber is:
RULE-APPLICATION-REQUIREMENT ORDERFW ORDERNUMBER #20120328T194203.480 GMT
The pr4_rule_usecase
table contains application specifications (Rule-Application-UseCase rule type).
Item |
Description |
Database table |
|
pzInsKey elements |
pxObjClass pxInsName pxCreateDateTime |
Rows |
Application specifications |
Indexes |
Using multiple indexes, flows can be selected by their class (pxObjClass) and visible key (pxInsName). |
For example, the pzInsKey value for the use case OrderFW.Purchase.StartPurchase is:
RULE-APPLICATION-USECASE ORDERFW PURCHASE!STARTPURCHASE #20120328T194203.480 GMT
The pr4_fieldvalue
table contains field value rules (Rule-Obj-FieldValue rule type).
Item |
Description |
Database table |
|
pzInsKey elements |
pxObjClass pyClassName pyFlowName pxCreateDateTime |
Rows |
Standard field value rules and field value rules in your application rulesets. |
For example, the field value rule Work-.pyStatusWork.New defines a value used in the Local List for the work item status property pyStatusWork. The pzInsKey is:
RULE-OBJ-FIELDVALUE WORK- PYSTATUSWORK!NEW #20040928T000337.867 GMT
Instances of the following rule types are stored as rows of the pr4_rule_file
table:
Item |
Description |
Database table | pr4_rule_file
|
pzInsKey elements |
pxObjClass pyClassName pyFileName pyFileType pxCreateDateTime |
Rows |
Standard Rule-File- rules and other rows for rules in your application rulesets. |
For example, the binary file rule named webwb.image19.gif holds the Compuserve GIF file used on the standard log-on form. The pzInsKey value for the this rule is:
RULE-FILE-BINARY WEBWB IMAGE19!GIF #20040107T153125.857 GMT
For a binary file rule, the system converts the binary file (such as a JPG image or Windows DLL) to text characters using Base64 coding. These rules are stored in the pzPVStream column (Storage Stream or BLOB). Similarly for an eForm file rule, a PDF file is stored within the pzPVStream column.
Instances of the Rule-Generated-Activity and Rule-System-Generated-Access classes contain system-generated information. These rule instances are stored as rows in the pr4_rule_sysgen
table.
RuleSets (Rule-RuleSet-Name) and RuleSet versions (Rule-RuleSet-Version) are stored in a foundation table, pr4_rule_ruleset
.
Class rules (Rule-Obj-Class) are stored in a foundation table, pr4_base
.
Shortcut rules and category rules, which support the Report Browser, are stored in the pr4_rule_shortcut
table.
Rules types that support the Automated Unit Testing facility (Rule-Autotest-) are stored in the pr4_rule_autotest
table.
By default, rules of types other than those presented above are stored in the pr4_rule
table.
If you create a custom rule type you can also create a dedicated database table to hold the rules and the associated triggers that the table requires. This table eliminates the risk that future Pegasystems upgrades to the standard database tables listed above might interfere with the exposed columns and other details needed by the custom rule type. However, this also means that after an upgrade you might have to take extra steps to ensure that your rule table and its associated triggers are correct and up to date. In most cases, it is easier to use an existing rule table and, if necessary, optimize a few extra columns to expose the data your rule type needs.