You are here: Reference > Activity methods > Obj-Filter

Obj-Filter method

Use the Obj-Filter method to filter the embedded pages of a results page (such as a Code-Pega-List page produced by the RDB-List, Obj-List-View or Obj-Browse methods) based on one or more when condition rules.

For example, if each embedded page on results page contains a Page List property Child and each Child page contains a Single Value property FirstName, you can use the Obj-Filter method to remove all embedded pages where no value of FirstName is "Robert".

Note: For best performance, use an Obj-Browse method to search and retrieve instances of a class where the selection criteria involve only Single Value properties exposed as columns in the PegaRULES database. Use the Obj-Filter method to refine search results by deleting pages based on when condition tests that involve non-exposed property values, including aggregate properties.

Parameters

This method has two required parameters and an array parameter.

Parameter

Description

ListPage

Name of the results page, of class Code-Pega-List.

ResultClass

Select the Applies To key part of one or more when condition rules (Rule-Obj-When) to be used to test each result. Must match or be an ancestor class of the class of the embedded pages in the ListPage page.

When

Complete at least one row of this array, specifying a when condition rule. Enter the second key part (When Name) of a when condition rule. Typically, the comparisons and expressions in the when condition rule involve one or more aggregate properties or unexposed properties.

Note: Because the embedded pages may contain only a portion — not all — of the properties of the listed instances, make sure the when condition rule you identify here involves only the properties that are expected to be present. If your when condition rule mentions a property not present on the embedded page, the system uses the null value in the when rule evaluation, not the true value that is saved in the PegaRULES database.

Results

At runtime, the system uses rule resolution to find the when condition rules.

It applies the when condition rules to each embedded page, and deletes any embedded pages for which any when condition evaluates to false.

The embedded pages for which all when condition rules evaluated to true are not affected.

The contents of surviving embedded pages are not affected.

Checking the method status

This method updates the pxMethodStatus property. See How to test method results using a transition.

Definitions Results page
Related topics Obj-Browse method
Obj-List-View method
Standard rules Standard properties for search results (Code-Pega-List class)

Methods and instructions by function