Back Forward About the Declarative Index wizard

Show all 

Proj-840 5.4 To speed reporting, searching, or other access, you can create a Declare Index rule automatically for a property embedded in a Page, Page List, or Page Group property. A wizard guides you through the necessary steps. This feature requires a user account for the PegaRULES database that has specific capabilities and privileges.

For example, if the work objects in your application can contain an array with possibly many Universal Product Code (UPC) codes, you can create these with the wizard:

A new class (derived from the Index- base class) to hold declarative index instances

As with Declare Index rules that you create with the Declare Index rule form, indexing begins immediately

NoteDon't confuse declarative indexes (instance of a concrete class derived from the Index- base class) with database indexes (defined through database software facilities, typically by a database administrator). The purpose and goals are similar, but the specific mechanisms are different.

NoteAfter you implement a declarative index, reports can use the indexed property value as a selection criterion. For example, if the embedded Universal Product Code (UPC) codes in a work object are indexed, you can report on all work objects containing a specific UPC code. Reference the index class on the Contents and Join tabs of the List View form or Summary View form.

Examples

For an example use of the wizard including screen images, see Pega Developer Network article PDNPRKB-25278 How to create Declarative indexes for embedded properties.

As a second example: A purchasing application contains a work type MyCo-PurchaseRequest. The Page List property PurchaseRequest.Lines() contains one page for each line item. The property Lines has the Page Class value Embed-PR-Line. Single Value properties on this page identify a product (by Universal Product Code or UPC), the quantity, and other details.

In this data structure, you cannot expose the property MyCo-PurchaseRequest.Lines().UPC, as it is embedded. Accordingly, you cannot select all work objects that include a specific UPC value in a list view report. However, you can create an index using the Declarative Index wizard, and then join the index with the work object in a report.

The wizard creates several rules and one data instance:

Before you begin

This feature requires access to a PegaRULES database account that has the ability to define database tables (specifically, the ALTER TABLE and CREATE TABLE grants or privileges).

You can identify the account name and password on the Database Table form for the PegaRULES database, by completing the Admin UserName and Admin Password fields on the Database tab. Alternatively, for greater security, add two or three elements in the prconfig.xml file to identify this account, in the following format:

<env name="database/databases/PegaRULES/adminUserName" value="usn" />
<env name="database/databases/PegaRULES/adminPassword" value="pwd" />
<env name="database/databases/PegaRULES/databaseType" value="type" />

where usn is a user name, pwd is a password, and type is one of the keywords (note spaces and capitalization)

The databaseType element is optional. You can omit the databaseType element in the common case that your JDBC driver software is supplied by the database vendor; for example, if you obtained the Oracle JDBC driver from Oracle Corporation.

NoteIf policies or practices in your organization do not allow the creation of a database user account with the necessary granted privileges, you can use the Declarative Index wizard to create the rules and the Database Table instance (Data-Admin-DB-Table). In this situation, the wizard cannot create the PegaRULES database table; you can ask a database administrator who has the appropriate authority to perform the CREATE TABLE SQL statement. See How to set up an index.

Using the wizard

To create a declarative index on an embedded property:

  1. Plan ahead to identify the RuleSet and Version to contain the rules created by the wizard.
  2. Review existing Declare Index rules to confirm that the property is not already indexed. (Do not attempt to use this wizard to index a property that is already indexed.)
  3. Locate the embedded property in the Application Explorer. The property can be embedded in a Page, Page List, or Page Group property.
  4. Right-click to access the Application Explorer context menu. Select Index Property from the menu.
  5. On the first pop-up window that appears, select a RuleSet and Version to hold the rules generated by this wizard. Click Submit.
  6. A confirmation form identifies the class, property and Declare Index rule created. Indexing operations are started. You can click the pencil icon (Pencil ) to review the rules.

Notes

The PegaRULES database tables created by this wizard have names than end in -idx. This naming convention is distinct from the names of standard tables for Index- instances, which start with pr_index_.

You can run the standard activity Code-.RecreateIndexesForClass to rebuild indexes for all the instances of a single concrete class, identified by an activity parameter.

CautionThe Code-.RecreateIndexesForClass activity does not remove existing dangling instances, those that reference a deleted or renamed object. However, normal declarative index processing removes index instances when the use count reaches zero, so dangling instances can only occur through errors and exceptional situations.

CautionIf your application contains thousands or millions of existing instances to be processed by this activity, processing may take hours and can impact overall system performance. Consider off-hours or agent processing.

Definition Index base class
Related topics About Declare Index rules
About Database data instances

UpTools, accelerators, and wizards