Methods for calculating differences
In many cases, you can use the base configuration logic to trigger difference calculations for the two basic types of
differences. If you need to change the application behavior, you can vary application logic based on the
difference reason. You trigger difference calculations by using either of the following two methods on the
PolicyPeriod entity instance: getDiffItems and compareTo.
Each method takes a DiffReason typecode as an argument. If the typecodes that the base
configuration provides do not meet your needs, you can extend the DiffReason typelist with
additional difference reasons.
Differences between a branch and its based-on branch
You can get a list of differences between a branch and its based-on branch, by using DiffItem
filtering from the policy difference plugin. This filtering is similar to what is done for policy change. This
list of differences is generated from the database. Call the getDiffItems method on a
PolicyPeriod entity.
myDifferences = myPolicyPeriod.getDiffItems(DiffReason.TC_INTEGRATION)You use code similar to this line in cases such as if you write integration messaging code to notify an external system of changes from Policy Change jobs. You might also use this approach to compare a renewal with the period on which it was based. However, you might prefer to use the compareTo method for renewals in some edge cases.
Differences between any two branches
You can get a list of differences between any two branches in the same period, similar to what is done in the multi-version user interface. Call the compareTo method on a PolicyPeriod entity and pass it another PolicyPeriod entity.
myDifferences = myPolicyPeriod.compareTo(DiffReason.TC_MULTIVERSIONJOB, anotherPolicyPeriod)You use code similar to this line in cases such as if you write new PCF code to compare arbitrary revisions, or a web service that compares two policy periods.
