Difference item subclasses

PolicyCenter provides several types of difference items, all of which are subclasses of the gw.api.diff.DiffItem class. The reference implementation of the policy period difference plugin instantiates only property-change and bean-addition difference items. You can customize the reference implementation to use any of the classes, according to your business requirements. The following table describes these classes. The rightmost columns in the table indicate which objects are instantiated in the reference implementation in different contexts.

Class

Description

Created if comparing two branch graphs

Created by database generation of difference items

DiffAdd

An entity instance was added that did not exist previously.

Yes

Yes

DiffProperty

A property changed in an entity instance.

Yes

Yes

DiffRemove

An entity instance was removed that existed previously.

Yes

Yes

DiffWindow

A change in window mode to an entity instance’s effective or expiration dates. Window mode means the change is made while viewing a PolicyPeriod and its subobjects across all effective dates in the period.

This object is not created in a multiple revision job such as a multiple revision quote. PolicyCenter can add a DiffWindow object during comparison of two branch graphs. Comparing two branch graphs may pertain to multi-version or comparing jobs.

Yes, but not in multiple-revision jobs

Yes

You can create these difference items directly by using their constructors, with code like the following Java lines.

DiffAdd diff = new DiffAdd(newElem);
diff.setPath(ctx.getPath());

Alternatively, use APIs to create difference items by comparing entities in two branches.