Customizing personal auto line of business
The existing configuration includes several classes to add and filter differences for personal auto line of business.
In personal auto multi-version differences, PolicyCenter first compares the vehicles, coverages, and cost entities. Next, PolicyCenter generates a list of DiffItem objects from the differences.
The Gosu class PADiffHelper contains a method
addDiffItems which calls
the DiffUtil comparison
methods to compare vehicles, coverages, and costs. The DiffUtil comparison methods compare
and return a list of DiffItem
objects from differences between the entities.
The most important feature of the DiffUtil class’s compareFields method for personal auto multi-version differences because it allows you to compare an array off of a entity. For instance, PolicyCenter compares the vehicles array from the two personal auto line objects that represent two versions in multiple version quote.
Calling the compareField with a depth argument
set to 2 traverses the vehicle graph to a depth of 2. In other words,
for every vehicle compared, it automatically compares properties from
that vehicle (depth level 1) and its referenced coverages (depth level 2).
The code that accesses these differences looks like the following statement.
paDiffs.addAll(diffUtils.compareField(line1, line2,
PersonalAutoLine.TypeInfo.getProperty( "Vehicles"), 2))
In the PADiffHelper class, the filterDiffItems method filters out all unnecessarily added difference items. This method is called from the addDiffItems method. If you want to customize which properties specific to personal auto policies to be filtered, modify this method.
Also in the PADiffHelper class is the compareBranches method. PolicyCenter
passes this method the two PolicyPeriod
objects of the two personal auto quotes, the difference reason (DiffReason), an enumeration to
specify the business context for the difference detection.
The addDiffItems method is called from the compareBranches method.
// Add diffs by line of business
for (line1 in p1.Lines){
if (line1.Subtype.Code == "PersonalAutoLine") {
diffs = new PADiffHelper().AutoDiffItems(line1 as PersonalAutoLine,
line2 as PersonalAutoLine)
as ArrayList<DiffItem>
}
}
Customize this code if you need different application
logic. The addDiffItems
method in PADiffHelper
adds individual compared properties. For example, it adds line coverages
and vehicle differences using code like that shown below.
// Add line coverage diffs
var paDiffs = diffUtils.compareField( line1, line2,
PersonalAutoLine.TypeInfo.getProperty( "PALineCoverages"), 2)
// Add vehicle diffs
paDiffs.addAll(diffUtils.compareField( line1, line2,
PersonalAutoLine.TypeInfo.getProperty( "Vehicles"), 2))
Refer to the PADiffHelper.gs class for full details of what it does for that line of business.
The difference tree for personal auto is contained in the PADiffTree.xml file. The user interface for the difference tree is controlled by the XML file.
