Configure rule engine file (rules spreadsheet)
Table of Contents
- 1 Introduction
- 2 Example 1 - Validate Promotion Code applied to a Quote
- 3 Example 2 - Validate Date of Loss upon Claim Registration
- 4 Example 3 - Validate Reserve Amount upon Claim Reserve creation
- 5 Example 4 - Validate Payment Amount upon Claim Payment creation
- 6 Example 5 - Validate Recovery Received Amount upon Claim Recovery Received creation
Introduction
There are two system sheets that you should not change the sheet name and column header in the sheet. These sheets are required and used by system to execute the rules:
Field Data Inputs sheet: defines input parameters. Row 1 is column header. From row 2, you need to define the data fields and corresponding converted input parameters.
Field Name column: Raw input parameter name or data field. It will tell which data (i.e. placeholders) is retrieved from available Seamless services.
Converted Parameter column: Define parameter name that will be used in the Rules spreadsheet.
Description column
Rule Declarations sheet: defines the rules and what is the rule’s decision table as well as output parameters. This sheet contains list of rules. Each rule is defined on each row.
Rule Name column: define any rule name.
Rule Inputs column: define parameter name for the rule. Pickup from column B in sheet "Field Data Inputs". If more than one input, use "," to separate.
Rule Sheet Name column: Define the name of sheet containing decision table to get the result based on a set of input values. Name can be whatever but you need to create a new sheet with this name.
Rule Outputs To Parameters column: Define output parameter name of the rule. Output can be any data type: string, Boolean, number… Examples: For promotion code: the output must be Boolean. For customer scoring: the output is number.
Decision table sheet: define the possible input values (conditions) and the output result. Mostly, we need to define all of the expected conditions with expected result, others will fall in default condition with default result. Row 1 is column header. Row 2 is to define what input parameter to be used to get value for condition check. $param will be replaced by the value of the same column and the following rows (from row 3).
Condition column: define the condition to check. If there are more than one condition, you need to add more Condition columns.
Action column: define the output result.
From row 3, you need to define all of the expected conditions with expected result.
To avoid listing unlimited conditions, you need to define the default condition. So if the input values don’t fall into expected conditions, it will fall in default condition with default result.
Condition values are case-sensitive. For ex: if the values in rule sheet is defined as “Renewal”, when user provides “renewal” as the input for the rule, system will not recognize it and it will fall in default condition with default result.
Constants sheet: If the case does not fall in any conditions in the decision table sheet "NewBusinesQuote", system will return the error (column C) and error message (column B). This is a default sheet, please do not change.
Example 1 - Validate Promotion Code applied to a Quote
Define a rule to check if a promotion code is valid or not when applied to a quote.
Conditions: promotion code can be applied to Travel quote only upon new business or renewal.
Example file:
Field Data Inputs sheet:
There are 2 input parameters defined: quoteBusinessFlow and quoteProductName.
The data field of those 2 input parameters are quote.businessFlow and quote.productName respectively. These data field name are fixed (defined by Seamless services, please do not change).
Rule Declarations sheet:
There is one rule which has 2 input parameters: quoteBusinessFlow and quoteProductName (they are defined in sheet Field Data Inputs).
And 1 output parameter, named “is_valid” (this means “Promotion code is valid or not).
“NewBusinessQuote” is the sheet name where contains decision table to get the result based on a set of input values from 2 input parameters quoteBusinessFlow and quoteProductName. So you will see a sheet “NewBusinessQuote” next to.
NewBusinessQuote sheet:
There are two conditions to check: one condition on quoteBusinessFlow. The expected values are “NewBusiness” or “Renewal” (These values are understood by the Seamless services).
And another condition on quoteProductName. The expected value is “Travel” (Please use the correct name defined in Product Builder).
From row 3, you need to list all of the conditions that the output result is_valid should be TRUE. So here are 2 valid combinations {“New Business”, “Travel”} and {“Renewal”, “Travel”), which is_valid = TRUE. And others will fall in default condition, hence is_valid = FALSE.
Condition values are case-sensitive. For ex: the value in rule sheet is defined as “Renewal”, when user provides “renewal” as the input for the rule, system will not recognize it and it will fall in default condition with is_valid = FALSE.
Example 2 - Validate Date of Loss upon Claim Registration
Define a rule to check when creating a new claim, Date of Loss should be not in the future or outside the policy effective period.
If Date of Loss is in the future or outside the policy effective period, it will return a validation message.
Example file:
Example 3 - Validate Reserve Amount upon Claim Reserve creation
Define a rule to check when creating a new claim reserve, the new total reserve amount of the cover in one claim should not exceed the policy’s cover limit.
If the new total reserve amount of the cover in one claim exceeds the policy’s cover limit, it will return the validation message “Total reserve amount of cover is greater than cover limit.”
Example file:
Example 4 - Validate Payment Amount upon Claim Payment creation
Define a rule to check when creating a new claim payment, the new total payment amount should not exceed total reserve amount of the same cover, damage/injury type, cause type, payment code in one claim.
If new total payment amount exceeds total reserve amount of the same cover, damage/injury type, cause type, payment code in one claim, it will return the validation message “Total payment amount is greater than the corresponding total reserve amount.”
Example file:
Example 5 - Validate Recovery Received Amount upon Claim Recovery Received creation
Define a rule to check when creating a new claim recovery received, the new total recovery received amount should not exceed total recovery amount of the same cover, damage/injury type, cause type, payment code in one claim.
If new total recovery received amount exceeds total recovery amount of the same cover, damage/injury type, cause type, payment code in one claim, it will return the validation message “Total recovery received amount is greater than the corresponding total recovery amount.”
Example file:
Related content
If you would like to request an article, drop us a mail at seamless.support@seamless.insure