Rating Scripts
Info Function (Refer/Decline/Endorsement)
ICE Rating comes pre-built with an info function to handle referrals/declines and endorsement triggers. The function takes in two arguments: The trigger type and an array which includes a code and a message.
Refer
A referral can be triggered using the below syntax:
info('Refer', ['CODE', 'Message'])When run, this will trigger a referral which will appear in ICE Rating. In the below image, the code is 'TireExpiration' and the message is 'TireExpiration is Over 24 Months'.

Decline
A decline can be triggered using the below syntax:
info('Decline', ['CODE', 'Message'])Similar to the referral trigger, the code and message type is not strict, however, the code is not displayed when returned to ICE Policy.
Endorsement
An endorsement can be triggered using the below syntax:
With endorsement triggers, the message is not displayed in ICE Policy, however, the code must match the code of the endorsement you wish to trigger within ICE Admin. If you have not setup an endorsement, see Creating a New Endorsement.
Custom Endorsements
On occasion, there may be a requirement to trigger a custom endorsement (an endorsement with a variable element). The syntax for this can be found below:
Similar to the standard endorsement trigger, the Message is not displayed, however, there are a couple of key differences:
The "{value}" item is the name of the endorsement variable within ICE Admin configured without the leading “$”
The "variable_contents" is what you wish to be displayed on the endorsement. This type is not specific, so you can pass a variable to this of any type.
If you have not set up an endorsement specified for custom endorsements, see Creating a New Custom Endorsement.
gt, ge, lt, le
As the rating scripts are embedded within an XML file, there are a few points to consider that may lead to a corrupted file. The use of the '>' and '<' characters are reserved for opening and closing tags, so should be avoided within conditionals. To avoid any errors, ICE have imported the gt(), ge(), lt() and le() functions from the operator package by default.
These functions are to perform “rich comparisons” between a and b. Specifically, lt(a, b) is equivalent to a < b, le(a, b) is equivalent to a <= b
An example of how this can be used:
Read more about them here!
Last updated