Extend parallel rating using entities to another line of business

These instructions provide general guidance.

About this task

The rating engine that you modify in the following steps is XXRatingEngine.gs, where XX is the code for the line of business. For example, CPRatingEngine.gs is the rating engine for commercial property.

Procedure

  1. In your implementation of XXPolicyLineMethods.gs for the line of business, override the PolicyLineMethods#shouldParallelizeRating method to return true, or return true when other conditions are met. For example, if you wish to limit parallel rating to policies with a large number of coverables, add that logic to this method.
  2. Modify the rating engine for the line of business to extend AbstractEntityParallelRatingEngine instead of AbstractRatingEngine.
    For example, CPRatingEngine.gs class is declared as:
    class CPRatingEngine extends AbstractEntityParallelRatingEngine<CPLine, EffDated>
  3. Modify the rateSlice method in the rating engine for parallel rating. In rateSlice:
    1. Call the preRateStep method. In the base configuration, this method is defined in AbstractParallelRatingEngineBase. If you need to customize this method for this line of business, add a preRateStep method to XXRatingEngine.
    2. Call the rateInParallel method and pass in the list of coverables to rate in parallel and the code block that rates each coverable.
    3. Call the handleFutures method on the list of Futures returned from rateInParallel.
    4. Call the postRateStep method. In the base configuration, this method is defined in AbstractParallelRatingEngine. If necessary, customize as for preRateStep.