Results
A case match rule returns the results to the pxResults property of a Code-Pega-List page on the clipboard. The results can be examined and then displayed, perhaps in a report, or used in an executing application. The results page also includes the following properties:
- pxHighestScore — Highest score among the matching cases
- pxRuleUsed — Key of the case match rule used
- pxTotalDiscarded — Number of cases that were discarded because their score was lower than the cutoff score (not counting those eliminated by When conditions in the Retrieval tab)
- pxResultCount — The number of matching cases found
On each embedded page, the pxMatchScore property holds the score of the case.
Planning and developing a case match rule
Complete two basic steps to specify and use a case match rule.
First, write two activities that interact with the case match rule you create; a content activity to select cases, and a calling activity to evaluate the case match rule. Then complete the Case Match rule form, which references the content activity.
The high-level steps are:
- Write a calling activity that calls the standard activity SeekCases or SeekFirstCase, depending on which type of rule you want to use. (These activities are in @baseclass.)
- The SeekFirstCase or SeekCases activity calls the case match rule you specify.
- The case match rule references the Content Activity. You write this activity to select the cases you want to evaluate and score and retrieves the properties needed for the computation.
- If you specified When conditions on the Retrieval tab, the SeekCases or SeekFirstCase activity then carries out the filtering. For case match rules called with SeekFirstCase, surviving cases are next sorted by the properties listed on the Retrieval tab.
- The SeekCases or SeekFirstCase activity then evaluates each case according to the scoring formulas on the Evaluation tab, to obtain a score for each case.
- The SeekFirstCase activity returns the first case it finds that has a score equal to or higher than the cutoff score specified in on the Evaluation tab.
- The SeekCases activity returns all the cases with a score equal to or higher than the cut off score specified in the case match rule.
- The results are placed in the pxResults property of a page of class Code-Pega-List in the clipboard.
- You can use the results in your application.
Note: Remember to anticipate and handle the possibility that no cases meet the retrieval criteria, or that none of the retrieved cases meet the cutoff score.
Example
A case match rule can combine multiple factors into a single numeric score. The Pega 7 Platform expressions and functions can compute factors that add into the score. For example, when a customer (or other party) identifier isn't known but the ZIP code is available, a case match rule can retrieve all the customers in that ZIP code and score those who:
- Have gold or platinum status
- Are a participant in one or more open work items
- Are a participant in one or more recently resolved work items
- Have a recent address change and moved into that ZIP code
and so on.
Viewing the Java code of a rule
Click Actions > View Java to view the generated Java of a rule. You can use the Java code to debug your application or to examine how rules are implemented.
Open topic with navigation