Underwriting company plugin
To customize how PolicyCenter finds which underwriting
companies are available for a set of jurisdictions, implement your own
version of the underwriting company plugin interface, IUWCompanyPlugin.
There is only one method on the plugin,
which is findUWCompaniesForStates.
Your implementation of this method must find all underwriting companies
that are available for the set of jurisdictions (states) associated with
this policy. You return the list of under writing companies as a set
(java.util.Set) of underwriting
companies (UWCompany).
Using Gosu generics notation, the type you need to return is Set<UWCompany>. If you want
to filter the jurisdictions by product and effective date, you can choose
to filter using those properties.
The method parameters are a policy period
(PolicyPeriod) and a Boolean
parameter called allStates.
The usage of the allStates
parameter is described below.
- If
allStatesistrue, only return a company if the underwriting company contains all jurisdictions associated with the policy. - If
allStatesisfalse, only return a company if the underwriting company contains any jurisdictions associated with the policy.
The built-in implementation of this plugin calls a
built-in class to find underwriting companies by jurisdictions and product
and valid on a specific date. It uses the allStates parameter, querying
the UWCompany table with
a conjunctive or disjunctive reverse join through the LicensedState table per state,
depending on the value of the allStates
value.
The following Gosu code example demonstrates this approach.
class UWCompanyPlugin implements IUWCompanyPlugin {
/**
* Finds all the underwriting companies that are available for the states in the set.
* Also allows filtering of the States by product and effective date.
* Does not return UWCompanies of "retired" status.
*
* @param period The Policy Period
* @param allStates If true, *all* states must be found on the UWCompany;
* if false, *any* must be found.
* @return A query of underwriting companies
*/
override function findUWCompaniesForStates(period : PolicyPeriod, allStates : boolean)
: Set<UWCompany> {
// This OOTB implementation goes through Guidewire's UWCompanyFinder to retrieve the UWCompanies
// The finder queries on the UWCompany table with a conjunctive or disjunctive reverse join through
// the LicensedState table per state, depending on the value of allStates.
return PCDependencies.getUWCompanyFinder().findUWCompaniesByStatesAndProductAndValidOnDate(
period.AllCoveredStates, allStates, period.Policy.Product, period.PeriodStart).toSet()
}
}
