Extend the rating engine to execute new rate routines

About this task

If you add new rate routines in PolicyCenter, you must extend the rating engine for the line of business specified in the rate routine. The PCRatingPlugin class calls the rating engine for each line of business. In the base configuration, the rating engine classes that use rating management are PARatingEngine and CPRatingEngine.

Important: When adding code that executes a rate routine, be aware that simply executing a rate routine consumes both time and resources, whether or not the rate routine performs any actions. Therefore, only execute the rate routine when necessary. For example if a rate routine applies to a specific coverage on a policy, then make sure your code executes the rate routine only when the policy contains that coverage. The executeCalcRoutine method executes the rate routine.

To extend the rating engine to execute new rate routines:

Procedure

  1. In the rating engine, add code that calls the RateBook.executeCalcRoutine method. For example, to execute a new rate routine in personal auto, modify the PARatingEngine class in the gw.lob.pa.rating package.

    The method signature for executeCalcRoutine method is:

    function executeCalcRoutine(code : String, costData : CostData<Cost, PolicyLine>,
                                 worksheetContainer : WorksheetEntryContainer,
                                 paramSet : Map<CalcRoutineParamName,Object>)

    The arguments are:

    • code – The rate routine code that uniquely identifies the rate routine, as a String.
    • costData – The cost data object which contains properties you can use to calculate a rate, as a CostData.
    • worksheetContainer – Holds information for rating worksheets. Rating worksheets describe the series of calculations to generate a rate, as a WorksheetEntryContainer. For more information, see Rating worksheets in Rating Management.
    • paramSet – A map representing the parameters in the parameter set for the rate routine, as a java.util.Map.
  2. If the rate routines does not calculate properties on the cost, set the costData parameter to null and the worksheetContainer to a NoCostWorksheetContainer.
    For example, the following code in PARatingEngine.gs executes the pa_assign_driver_style1_rr rate routine:
    RateBook.executeCalcRoutine("pa_assign_driver_style1_rr", null, 
                                 new NoCostWorksheetContainer(), assignDriverParameterMap)

    The PARatingEngine class is in the gw.lob.pa.rating package. The NoCostWorksheetContainer stores data about what the rate routine executed. However, the default implementation of rating worksheets does not save this information to the database nor display it on the Rating Worksheet screen.

    The PARatingEngine class is in the gw.lob.pa.rating package. The NoCostWorksheetContainer stores data about what the rate routine executed. However, the default implementation of rating worksheets does not save this information to the database nor display it on the Rating Worksheet screen.

What to do next

See also