Rate routine plugin methods

The rate routine plugin implementation must contain these methods.

The built-in implementation of the rate routine plugin is RateRoutinePlugin.gs in the gw.plugin.rateflow package.

Set Parameters

The setParameters method gets the values of the WorksheetsEnabled parameter defined in the plugin registry and sets the values on internal variables. The value defined in the plugin registry overrides the plugin setting. The method signature is:

override function setParameters(params : Map<Object, Object>)

Get Cost Data Wrapper Type

The getCostDataWrapperType method gets the cost data wrapper type. The method signature is:

override function getCostDataWrapperType(paramSet : CalcRoutineParameterSet) : IType

In the built-in implementation, RateRoutinePlugin class transfers processing to the method of the same name in the line-specific rate configuration class, such as PARateRoutineConfig.

In the line-specific configuration class, the getCostDataWrapperType method gets the wrapper type that will be used by rate routines for the given parameter set. The rate routine editor accesses a CostData instance using this wrapper type. The rate routine editor uses the wrapper to display the desired set of properties related to CostData in virtual form. For example, when entering an Instruction or Operand in a rate routine step in PolicyCenter, you can select a property on the cost such as AdjustedRate. The wrapper implementation maps AdjustedRate to the correct underlying CostData property: StandardAdjRate, OverrideAdjRate, or ActualAdjRate. For example, if the CostData supports overrides, this could be the override or standard property. If the CostData does not support overrides, it is almost certainly the standard property.

The parameter is:

paramSet

The parameter set for which to return the corresponding wrapper type

The method returns the IType corresponding to the instance that makeCostDataWrapper would return for the given paramSet.

Make Cost Data Wrapper

The makeCostDataWrapper method makes the cost data wrapper. The method signature is:

override function makeCostDataWrapper(
          paramSet : CalcRoutineParameterSet, 
          costData : CostDataBase, 
          defaultRoundingLevel : Integer, 
          defaultRoundingMode : RoundingMode) : ICostDataWrapper

In the built-in implementation, RateRoutinePlugin.gs transfers processing to the method of the same name in the line-specific rate configuration class, such as PARateRoutineConfig.gs.

In the line-specific configuration class, the makeCostDataWrapper method makes a wrapper for the given CostData instance.

The parameters are:

paramSet

The parameter set for which to return the corresponding wrapper

costData

An instance of the CostData subclass

defaultRoundingLevel

The default rounding level of the CostData

defaultRoundingMode

The default rounding mode of the CostData

The method returns a wrapper instance of the IType that getCostDataWrapperType returns for the paramSet.

Enable Worksheets for a Policy Line

The worksheetsEnabledForLine method returns true if worksheets are enabled for a policy line. The method signature is:

override function worksheetsEnabledForLine(linePatternCode : String) : boolean

In the built-in implementation, RateRoutinePlugin.gs enables worksheets for a policy line if the worksheetsEnabledForLine method in the line-specific configuration class returns true.

The parameter is:

linePatternCode

Pattern code for a line of business

The method returns true if worksheets are enabled for the line of business with the given pattern.

For more information, see Add an implementation to a Plugins Registry item.

Treat Type as Primitive

You can call the treatTypeAsPrimitive method to determine whether to treat a type as a primitive (atomic) or whether to expose its fields. When traversing the rating entity graph, PolicyCenter calls this method. If the type is primitive, stop traversal of that branch.

The parameter is:

t

The type under consideration.

The method returns true to treat the supplied type as a primitive.

Get Branching Fields

The property getter for BranchingFields returns an array which is an ordered list of zero or more branching fields which represent variant identifiers of a rate routine. The fields together with Code and Version on the CalcRoutineDefinition entity uniquely identify a rate routine. A rate routine and its variant identifiers have the same code. The signature is:

override property get BranchingFields() : IEntityPropertyInfo[]

In the default configuration, jurisdiction is an example of a rate routine variant identifier. In the PolicyCenter user interface, the jurisdiction variant is referred to as the jurisdiction variant.

If you add a new variant identifier, you must add the name of the variant identifier to the fields variable of the getter for the BranchingFields property.

For more information about adding a variant identifier, see Configuring variant identifiers for a rate routine.

Include Property

The includeProperty method is a filter on which properties on Parameters the user can select in an Instruction or Operand of a rate routine step. Return true to make a property available. Return false to make a property unavailable. Return null to retain the default value of this property. It is recommended that this method end with a catch-all return null, so that any property which is not explicitly handled gets default behavior.

The signature is:

override function includeProperty(policyLinePatternCode : String, prop : IPropertyInfo) : Boolean

The parameters are:

policyLinePatternCode

The code for the policy line.

prop

The descriptor for the property to include.

This method operates during the traversal of the policy graph, and controls whether a reference from one class to another will be traversed. (In contrast, the filterIrrelevantItems method runs after the traversal of the policy graph.)

For example, PolicyLocation has a foreign key to an AccountLocation. In the built-in implementation, PolicyLocation.AccountLocation is not traversed. To change this behavior, you might add the condition:

if (prop.OwnersType.isAssignableFrom(entity.PolicyLocation) and prop.Name == "AccountLocation") {
  return true
}

Filter Irrelevant Items

Similar to the includeProperty method, the filterIrrelevantItems method is a filter on which properties on Parameters the user can select in an Instruction or Operand of a rate routine step. However, this method runs after the traversal of the policy graph.

This filter runs after the traversal of the policy graph.

The signature is:

function filterIrrelevantItems(input : List<InScopeUsageBase>, policyLinePatternCode : String) :
  List<InScopeUsageBase>

In the built-in implementation, the RateRoutinePlugin class transfers processing to the method of the same name in the line-specific rate configuration class, such as PARateRoutineConfig. The built-in implementation calls the ItemFilter class which performs the default filtering. You can modify this class and add subclass helpers for specific implementations.

In the built-in implementation, ItemFilter considers the following types as irrelevant items:

  • Ignored paths – List of paths to filter out (defined in the _ignoredPaths variable). For example, the built-in implementation filters out .EffectiveDate and .ExpirationDate. See the plugin implementation for the complete list.
  • Ignored types – List of object types to filter out (defined in the _ignoredTypes variable). For example, the built-in implementation filters out policy period and policy line pattern. See the plugin implementation for the complete list.
  • Arrays or maps of types.You can optionally filter by policy line pattern code.