Posted: 18 Aug 2016 14:57 EDT Last activity: 9 Aug 2017 4:39 EDT
Optimize value list.
On a class I have a value list or value group. Now I want to get those values in report. For better performance of the report we should expose the property. But how to expose value list or value group.
Note I am not talking about page list or page group where a different class and table is created and pega get the values through join.
Please refer to the following from the PRPC help page "How to expose a property as a database column":
To expose embedded properties
Only top-level Single Value properties can be exposed as columns. Two tactics are available when you need a database column that contains the value of an embedded property:
Copy approach — Copy the value to a new top-level property each time the embedded property changes (or each time the instance containing the property is saved). For example, if a list view report needs to select rows based on property pyWorkPage.pxFlow("LoanDisburse").Sheet.Detail(4), you can:
Create a new top-level Single Value property to hold a copy of this value.
Create a one-step activity to copy the value to the new top-level property, with Activity Type set to Trigger.
Create a Declare Trigger rule that calls the activity each time the work item is saved.
Expose the top-level property.
Reference the top-level property in the list view rule.
Declare Index approach — If not one but many or all values of a Value List or Value Group are needed as exposed columns, a Declare Index rule is a better approach.
Create a concrete class derived from the Index- base class.
Create Single Value properties in the new class to hold values of the embedded values.
Create a Declare Index rule with the appropriate embedded Page Context value that copies the embedded values into a new Index- instance.
Save the Declare Index rule. It executes immediately, adding and deleting instances of the new class.
Expose database columns corresponding to the Index- class.
Reference the Index- properties in the list view rule.