Filtering difference items after creation of database records
One of the two difference item strategies is to compare a branch to its based-on branch. After PolicyCenter generates the full list of differences at the database level, it calls the policy period difference plugin method filterDiffItems to remove irrelevant differences.
In your plugin, you can add or change
the rules for filtering differences. You might use simple collection
Gosu methods to remove items, such as the following to remove all TerritoryCode information that
was added or removed from one branch to the other.
items.removeAll(items.findAll(\ d -> (d.Object typeis TerritoryCode)
and (d.Add == true or d.Remove == true)))
Alternatively, you can define your logic to apply only to certain conditions, such as the reason code that is a
parameter to the method. It is an enumeration called DiffReason containing values such as
TC_POLICYREVIEW, TC_INTEGRATION, TC_MULTIVERSIONJOB,
TC_PREEMPTION, TC_COMPAREJOBS.
For example, the following code filters differences for out of sequence jobs.
if (reason == DiffReason.TC_APPLYCHANGES) {
diffHelper = new DiffHelper(reason, null, null)
diffItems = diffHelper.filterDiffItems(diffItems)
}
You may want to update or add to the logic for each
line of business in the helper files such as PADiffHelper for personal auto.
After filtering the generated difference list, if PolicyCenter needs to display the differences to users, PolicyCenter passes the list to the difference tree generation system for furthering processing. You configure what differences the tree view displays and how the differences appear by customizing difference tree configuration XML files.
See also
