Define a method to get the rate factor
Before you begin
About this task
Follow these steps to define a getFactor method that gets the rate factor from a rate table. This method is general purpose and is not specific to a particular line of business. If you are adding Rating Management to multiple lines of business, you could choose to put this method in its own class.
Procedure
-
In the public method for the class, add private variables for storing the policy period and rate book status.
class WCRateFactorSearch { private var _period : PolicyPeriod as readonly Period private var _minRatingLevel : RateBookStatus as MinimumRatingLevel construct() { } -
Insert
usesstatements after the package statement at the top of the file. The method that you define in the following steps uses these classes.package gw.lob.wc.rating uses java.math.BigDecimal uses gw.rating.rtm.query.RateQueryParam uses java.lang.Comparable uses java.util.Date uses gw.rating.rtm.query.RateBookQueryFilter uses gw.job.RenewalProcess uses gw.rating.rtm.query.RatingQueryFacade class WCRateFactorSearch { -
After the class constructor, add the getFactor method that gets the rate factor.
construct() { } private function getFactor<Q extends Comparable>(jurisdiction : Jurisdiction, inputParams : List<RateQueryParam<Q>>, tableCode : String, ratingDate : Date) : BigDecimal { /* Constructs a new rateBookQueryFilter object and sets properties such as Jurisdiction */ /* and UWCompany. */ var filter = new RateBookQueryFilter(ratingDate, Period.RateAsOfDate, Period.WorkersCompLine.PatternCode) {:Jurisdiction = jurisdiction, :UWCompany = Period.UWCompany, :Offering = Period.Offering.CodeIdentifier, :MinimumRatingLevel = MinimumRatingLevel, :RenewalJob = Period.JobProcess typeis RenewalProcess } var result = new RatingQueryFacade().getFactor<Q, BigDecimal>(filter, tableCode, inputParams) return !result.Empty ? result.Factor : BigDecimal.ONE }The input parameters to the getFactor method are:
jurisdiction– The jurisdiction of the policy location.inputParams– Specify values for each parameter in the rate table.tableCode– The code of the rate table from which to obtain the rate factor. This is theTableCodeproperty on the RateTableDefinition object. In the user interface,tableCodeis the Code on the Basics tab of the Rate Table Definition screen.ratingDate– The date for which to obtain rates. The date is compared against theRateBook.EffectiveDateorRateBook.RenewalEffectiveDateproperties depending upon the job type. In the user interface,ratingDateis the Policy Effective or Coverage Reference Date or Renewal Effective Date in Policy Criteria on the Rate Book Details screen.
This method return the rate factor as a
BigDecimal. If no rate factor is found, the method return the value1.
What to do next
Now you can go to the next step, Define methods that get the rate factor.
