Modifier delegate example
To illustrate, in the base PolicyCenter configuration, PolicyCenter provides a
Modifier delegate. PolicyCenter
stores the delegate definition in file
Modifier.eti, in . The following is a simplified
version of this definition file.
<?xml version="1.0"?>
<delegate xmlns="http://guidewire.com/datamodel"
effdatedOnly="true"
extendable="true"
javaClass="com.guidewire.pc.domain.policy.Modifier"
name="Modifier"
requires="gw.api.domain.ModifierAdapter">
<fulldescription><![CDATA[A list of states and their rating factors (e.g. experience modification
for workers' compensation).]]></fulldescription>
<column desc="Boolean modifier"
name="BooleanModifier"
type="bit"/>
...
</delegate>
This delegate defines the following fields:
BooleanModifierDateModifierEligibleJustificationPatternCodeRateModifierReferenceDateInternalTypeKeyModifierValueFinalState(type list)
Any entity that wants to use the Modifier delegate functionality
must implement this delegate.
The modifier delegate extension
Suppose that you want to extend the definition of the Modifier entity in file Modifier.etx to add additional columns to the delegate entity. For example:
OverriddenRateModifierSuggestedRateModifier
The delegate extension code looks similar to the following.
<extension
xmlns="http://guidewire.com/datamodel"
entityName="Modifier">
<column
desc="The rate modifier that has been overridden."
name="OverriddenRateModifier"
type="rate">
</column>
<column
desc="The rate modifier that the external system has suggested."
name="SuggestedRateModifier"
type="rate">
</column>
</extension>
These fields are then accessible to any
entity that implements this delegate. You use these fields to support
user overrides of the modifier rates originally suggested by an external
process. All modifiers for all lines of business use this override process.
Thus, by placing this functionality in the Modifier delegate, each entity
that implements the Modifier
delegate inherits this functionality, instead of each entity implementing
this functionality separately.
Each line of business (LOB) uses one or two LOB-specific modifier entities that
implement the Modifier delegate. For example:
BAModifierBOPModifierCPModifierGLModifierPAModifierPAVehicleModifierProductModifierWCModifier
Because each of these LOB-specific modifier entities already implements the
Modifier entity, each automatically inherits the
Modifier column extensions.
If an entity does not already
implement the Modifier
delegate, then you need to do one of the following:
- If an extension
for that entity already exists in the Extensions
folder, then you need to modify that extension file so that it implements
the required delegate. In this case, modify the extension entity and
add the following, using the appropriate adapter name:
<implementsEntity adapter="xxx" name="Modifier"/> - If an extension
for that entity does not exist in the Extensions
folder, then you need to create an extension and have that entity extension
implement the required delegate. In this case, right-click the extensions
folder and select . Enter the entity name
and add the .etx extension.
Populate the extension file with something similar to the following,
using the appropriate adapter and entity name (
entityName):<?xml version="1.0"?> <extension xmlns="http://guidewire.com/datamodel" entityName="xxx"> <implementsEntity adapter="xxx" name="Modifier"/> </extension>
Modifier delegates and arrays
Delegate entities do not support arrays, so the Modifier delegate
does not include an array of
RateFactor entities. Instead each
concrete modifier type must define its own array
of rate factors. Therefore, for each entity that
implements the Modifier delegate
(for example, BAModifier), there
must also be a corresponding entity that
implements the RateFactor
delegate (for example,
BARateFactor)
Modifier delegates and adapters
Each entity that implements
the Modifier delegate
must specify an adapter class. Each adapter class must implement the
gw.api.domain.ModifierAdapter
interface. This interface implements generic modifier operations such
as returning the owning Modifiable
entity and working with the array of rate factors.
Similarly, entities that
implement the RateFactor
delegate must separately specify an adapter class that implements the
gw.api.domain.RateFactorAdapter
interface. This adapter needs to define one method only, one that returns
the owning Modifier.
To support out-of-sequence
and preemption handling, each modifier type must implement its own matcher
class. Each modifier and rate factor entity must separately implement
the gw.api.effdate.MatchableEffDated
interface. Guidewire provides the following classes as starting points
for configuration:
- gw.api.effdate.matcher.AbstractModifierMatcher.gs
- gw.api.effdate.matcher.AbstractRateFactorMatcher.gs
See also
