Considerations for rate routine functions

Functions provide a mechanism to execute arbitrary Gosu code from within a rate routine. Use functions:

  • To externalize logic that cannot be expressed in a rate routine. For example, looping through array elements.
  • For calculations that are secondary to the core purpose of calculating a rate. For example, calculating complex rate factors.
  • To simplify rate routines, and to retain the rate routine clarity as documentation of the rate calculation. Use worksheet logging to expose function actions to the rating worksheet when appropriate.

    If the business user needs to see the steps in the calculation or the algorithm needs to be versioned, then consider using a rate routine.

Functions do not have the same data access limitations as the rate routine editor does so they enable access all policy data. You can use functions to perform complicated rate table lookups, giving you greater control of the argument to parameter association. Functions can dynamically determine the rate table that you want to lookup.

Rate routine functions provide logic where the business user does not need to examine the interim steps of the calculation. For example, you can implement a function to calculate the average age of drivers on all vehicles in a policy. In the rating worksheet, the business user does not need to see how the function calculates the average age. In addition, computing the average age is always the same and does not need to be versioned over time.

See also