Create a new policy line rating engine
You can change PolicyCenter to use a custom rating engine for a particular policy line.
Procedure
-
Create a new subclass of
AbstractRatingEnginefor the rating line. You must use Gosu generics syntax to parameterize the type with the line of business class. The example below is taken from the CommercialPropertyLine class.class CPRatingEngine extends AbstractRatingEngine<CommercialPropertyLine> { -
Configure your line of business to instantiate your new rating engine class. In your PolicyLineMethods class
for your line of business, find the createRatingEngine method. This method must return an instance of your
new rating engine class. Method arguments include a rate method (
RateMethod) and a set of parameters as a java.util.Map object. Optionally use these arguments choose different rating engine subclasses. The following example instantiates a different rating engine if the rate method isTC_SYSTABLE.override function createRatingEngine(method : RateMethod, parameters : Map<RateEngineParameter, Object>) : AbstractRatingEngine<PersonalAutoLine> { if (RateMethod.TC_SYSTABLE == method) { return new PASysTableRatingEngine(_line as PersonalAutoLine) } return new PARatingEngine(_line as PersonalAutoLine, parameters[RateEngineParameter.TC_RATEBOOKSTATUS] as RateBookStatus) } -
Create a
CostDatasubclass for the line and further subclasses ofCostDatafor each subclass of cost on the line. - Decide whether your line can be rated from the change date forward only or whether PolicyCenter must re-rate the whole period.
-
Override methods on
AbstractRatingEngineto actually do the rate calculations. The exact methods might vary. - Consider encapsulating the logic for each type of rating in a separate class for each type of rating algorithm. You can put your actual rating formulas and table look-ups into these classes. Wherever your actual rating code is, separate your table look-up code from your formulas.
- If this line handles premium overrides, add relevant logic.
