Back Forward Working with the PegaRULES database — Tables for rules

Working with the PegaRULES database

Show all 

Ten database tables normally contain rules. Rule instances are heavily indexed to speed the searching operations used in rule resolution.

Introduction

The pzInsKey value for 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

Note The RuleSet and version are not part of this value. Rules of the same name (same visible key parts) in different RuleSets or versions have a different creation date and time.

Property rules

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

pr4_rule_property

pzInsKey elements

pxObjClass

pyClassName

pyPropertyName

pxCreateDateTime

Rows

About 6,000 standard properties, plus properties in your application RuleSets.

Indexes

Through multiple indexes, property rules 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

Flow rules

The pr4_rule_flow table contains flow rules (Rule-Obj-Flow rule type).

Item

 Description

Database table

pr4_rule_flow

pzInsKey elements

pxObjClass

pyClassName

pyFlowName

pxCreateDateTime

Rows

About 150 standard flow rules, plus flow rules in your application RuleSets.

Indexes

Through multiple indexes, flow rules 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

NoteFor each flow rule, the system saves a JPG image of the Visio diagram in a binary file rule (Rule-File-Binary rule type). The pyVisioRFB property holds the pzInsKey value of that binary file rule.

Field value rules

The pr4_fieldvalue table contains field value rules (Rule-Obj-FieldValue rule type). NOT pr4_rule_fieldvalue

Item

 Description

Database table

pr4_rule_fieldvalue

pzInsKey elements

pxObjClass

pyClassName

pyFlowName

pxCreateDateTime

Rows

About 2,000 standard field value rules, plus 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 object status property pyStatusWork. The pzInsKey is:

RULE-OBJ-FIELDVALUE WORK- PYSTATUSWORK!NEW #20040928T000337.867 GMT

 Rule-File-* rules

Instances of four 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

About 4,000 rows for standard Rule-File- rules, plus 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

NoteFor a binary file rule, the system converts the binary file (such as a JPG image or Windows DLL) to text characters using Base64 coding and stored within the pzPVStream column (Storage Stream, or BLOB). Similarly for an eForm file rule, a PDF file is stored within the pzPVStream column.

Generated rules

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. IS THIS OBSOLETE?

Class rules

Class rules (Rule-Obj-Class) are stored in the foundation table, pr4_base. See Table and Column Basics.

Report shortcuts and report category rules

Shortcut rules and category rules, which support the the Report Browser, are stored in the pr4_rule_shortcut table.

AutoTest rules

Rules of three rule types supporting the Automated Unit Testing facility (Rule-Autotest-) are stored in the pr4_rule_autotest table.

Rules of other types

By default, rules of types other than those presented above are stored in the pr4_rule table.

Advanced featureIf you create a custom rule type, also create a dedicated database table to hold the rules. This eliminates the risk that future Pegasystems upgrades to the standard database tables listed above may interfere with the exposed columns and other details needed by the custom rule type. See Pega Developer Network article PRKB-17585 Save custom rule types in a dedicated table in the PegaRULES database.

Reporting on rules

Rule resolution processing and reporting on rules depends on views and indexes as well as these tables.

Definitions base64 encoding,Storage Stream, visible key
Related topics How the system finds rules through rule resolution
Standard rules Atlas — Initial Database Table data instances

HomeWorking with the PegaRULES database