Extend parallel rating using entities to another line of business
These instructions provide general guidance.
About this task
Procedure
-
In your implementation of
XXPolicyLineMethods.gs for the line of business,
override the PolicyLineMethods#shouldParallelizeRating method to return
true, or returntruewhen 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. -
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> -
Modify the rateSlice method in the rating engine for parallel rating.
In rateSlice:
- 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.
- Call the rateInParallel method and pass in the list of coverables to rate in parallel and the code block that rates each coverable.
-
Call the handleFutures method on the list of
Futuresreturned from rateInParallel. - Call the postRateStep method. In the base configuration, this method is defined in AbstractParallelRatingEngine. If necessary, customize as for preRateStep.
