Duplicate finder classes

FindDuplicatesPlugin uses a set of duplicate finder classes, each of which defines:

  • The minimum set of fields required to attempt a match.
  • The fields required for exact matches for the ABContact subtype.
  • The fields required for potential matches for the ABContact subtype.

Each class checks for the existence of a minimum set of fields for performing a match with this subtype. If there is enough data for a match, the class can perform a search for potential matches and check the potential matches to see if any are an exact match.

If there is not enough data for a match, the validateMandatoryFields method throws a TooLooseContactDuplicateMatchCriteriaException. These exceptions use display keys, which you can access in Guidewire Studio™ for ContactManager. Navigate in the Project window to configuration > config > Localizations > Resource Bundle 'display' and double-click display.properties to open this file in the editor. In the editor, press Ctrl+F and search for TooLooseContactDuplicateMatchCriteriaException.

To view or edit the duplicate finder classes, start ContactManager Studio. Then, in the Project window, navigate to configuration > gsrc and then to gw.plugin.contact.findduplicates. Under this node, you see all the duplicate finder classes.

In these classes, you can change the logic required for matching a subtype. For example, you want to add a new field to the potential match logic in one of the duplicate finder classes. You must first add appropriate matching code for the field to the query builder class that supports that duplicate finder class. You then add the query finder method call to the duplicate finder class. For an example of a class that adds field matching logic, see PersonDuplicateFinder class.

The query builder classes are located one node down in the Project window. Navigate to configuration > gsrc and then to gw.plugin.contact.findduplicates.querybuilder. For more information on these classes, see Query builder classes.

You also might want to define new matching for an ABContact subtype that does not have a duplicate finder class. In this case, you would create a new duplicate finder class and a query builder class for the subtype.

Note: You do not have to add a duplicate finder class for any subtype, even a subtype extension that you create. Because the plugin traverses the ABContact tree to find the nearest parent type, any subtype of ABContact already has matching logic defined for it. Add a duplicate finder class only if you need special matching logic for a subtype.

The duplicate finder class descriptions that follow describe the functionality available in the base product. The CompanyDuplicateFinder description includes code for required fields, potential match, and exact match. The code in the other duplicate finders is similar.