Testing Formulas
This functionality allows the user to test premium calculation and underwriting formulas. The user must select an existing product, go to the Test Calculations tab, press the Insert button available on the grid, and add a test scenario. Depending on the scenario, the user also chooses which type of formulas are called for testing - either tariff or underwriting formulas, and picks the formula from a list. The test results are displayed right away and the user has the option to log them into the test grid.
Test calculations are performed according to the Tariff Type and Underwriting Type, set for the specified per product, or product item (coverage).
User Journey
General description: This form driven flow is based on the FTOS_IP_TestScenario entity. The form is used to configure a certain scenario type and see the output of the selected formula. The flow covers the following two situations:
-
When the test scenario type is set on Premium Amount, automatically the system triggers the tariff type and the corresponding field is shown. If the tariff type is
perProduct
, the form displays the Insurance Product Formula field. If the tariff type isperCoverage
, the form displays the Insurance Product Item Formula field. -
When the test scenario type is set on Verify Underwriting, the form displays the underwriting context type dropdown. Once a value for the context type is chosen, the system automatically triggers the underwriting type and the corresponding field is shown. If the underwriting type is
perProduct
, the form displays the Insurance Product Formula UW field. If the underwriting type isperCoverage
, the form displays the Insurance Product Item field.
After completing the values from the formula and saving it, the Calculate button is displayed. On click, the output of the formula is displayed in a grid.
View Default This view is used to see the list of all the test scenarios that were performed for an insurance product. From this view, the user can:
-
add a new test scenario by pressing the Insert button.
-
see the details of each test scenario by double-clicking the test record.
-
export the list of test scenarios - by clicking the Export button.
-
delete a record - by clicking the Delete button.
Default Form Functions
The default form driven flow uses the following functions:
This function gets the product configuration - namely, the tariff type and underwriting type (using ebs.callActionByNameAsync
method from FintechOS Client Side SDK) calling FTOS_IP_GetInsuranceProductType endpoint asynchronous.
Input parameters: N/A.
Output parameters: N/A.
This function changes some form fields to read-only if formData.mode
is in edit mode and formula output was calculated and saved in FTOS_IP_TestScenarioOutputid.
Input parameters: N/A.
Output parameters: N/A.
If formData.mode
is in insert mode, this function produces the name of the test scenario by concatenating the insurance product name and the current date. After that, it calls on the TestScenarioTypeChange
function with a test scenario type value.
Input parameters: N/A
Output parameters: N/A
Based on scenario type, underwriting type and product type, a set of rules and validations are set to show or hide some of the fields and views according to the requirements of the test scenario. (See the description in the user journey, above.)
Input parameters: data
- The object provided by ebs.addFormChangeEvent
method
Output parameters: N/A.
This function is triggered after changing a value (using ebs.addFormChangeEvent
method from FintechOS Client Side SDK) either for the Insurance Product Item Formula field, or for the Insurance Product Formula field. Once triggered, the function calls the getCalculationDetails
function with the currently selected value. Also, a set of rules and validations is set in this function, in order to show or hide some of the fields and views.
Input parameters: data
- The object provided by ebs.addFormChangeEvent
method
Output parameters: N/A.
This function is triggered after changing a value (using ebs.addFormChangeEvent
method from FintechOS Client Side SDK), either for the Insurance Product Item Underwriting field, or for the Insurance Product Underwriting field. Once triggered, the function calls the getCalculationDetails
function with the currently selected value. Also, a set of rules and validations is set in this function, in order to show or hide some of the fields and views.
Input parameters: data
- The object provided by ebs.addFormChangeEvent
method
Output parameters: N/A.
This function is triggered after changing the value (using ebs.addFormChangeEvent
method from FintechOS Client Side SDK) from the Underwriting Context Type field. Also, a set of rules and validations is set in this function, in order to show or hide some of the fields and views.
Input parameters: data
- The object provided by ebs.addFormChangeEvent
method
Output parameters: N/A.
Based on the selected items from the testing scenario form and from the tariff configuration from the insurance product form, this function fetches the necessary data from the formula to be tested, using ebs.callActionByNameAsync
method from FintechOS Client Side SDK, calling FTOS_IP_GetInsuranceProductCalculationDetails endpoint asynchronous. The functions populates the dataContainer grid with the values returned from the formula.
Input parameters: insuranceProductItemFormulaId
- The Id provided by addFormChangeEvent
.
Output parameters: N/A.
Based on the formula masterType
, ArgumentType
and objectProperties
, this function sets a default value type for each formula key, displayed in the formula grid.
Input parameters:
-
masterType
- The formulamasterType
display name. -
subType
- The formulaArgumentType
display name. -
objProps
- The object properties.
Output parameters: depending on the formula key type, this function can return different types of data: Boolean, string, array, etc.
This is an on click function.
The function calculates the output of the formula and displays it in a grid, based on the provided data. Using ebs.callActionByNameAsync
method from FintechOS Client Side SDK, this function calls either the FTOS_IP_CALC_TestVerifyUnderwriting, or the FTOS_IP_CALC_TestPremiumAmount endpoint asynchronous (depending on what is selected on the scenario type), with parameters provided by constructEndPointParams
function. Next, the function calculates the output of the formula and displays it in a grid.
Input parameters: N/A.
Output parameters: N/A.
Based on the scenarioType
, underwritingType
and productType
values, this function generates the endpoint parameters, necessary to call the async function.
Input parameters: obj
- The scenarioType
, underwritingType
and productType
values.
Output parameters: result
- The object with necessary parameters to call the async function.
This function prepares the display grid for the results of the formula that was previously calculated.
Input parameters: gridData
- The array of object elements (key/ value).
Output parameters: N/A.
Endpoints
Endpoint used to run the FTOS_IP_GetInsuranceProductType server automation script.
Endpoint used to run the FTOS_IP_GetInsuranceProductCalculationDetails server automation script.
Endpoint used to run the FTOS_IP_CALC_TestPremiumAmount server automation script.
Endpoint used to run the FTOS_IP_CALC_TestVerifyUnderwriting server automation script.
On Demand Scripts
Based on the provided product Id, this script calls the getInsuranceProductType
function, to fetch the insurance product type and underwriting type, and return the results.
Input parameters: insuranceProductId
- The insurance product Id.
Output parameters: fetchProductType
- The collection of records.
This script is called with a data object. The object calls the getInsuranceProductCalculationDetails
function in order to return the formula (attached to the product, or coverage), based on the chosen values from test scenario form. The function includes four fetches, but only executes the fetch specified by the values provided in the object.
Input parameters: obj
- An object containing the following keys:
-
scenarioType
, -
productType
, -
underwritingType
, -
insuranceProductItemFormulaId
, -
insuranceProductId
, -
insuranceProductItemId
, -
underwrittingContextTypeId
.
Output parameters: fetchCalculationDetails
- The collection of records.
This script is called with a data object.
Based on the configured tariff type, the object calls either the testProdPremiumAmount
, or the testPremiumAmount
function - from the FTOS.IP_CALC.FormulaEngineHelper server automation script library.
Next, it receives the calculation results of the corresponding formula and saves the response in the FTOS_IP_TestScenarioOutput entity - if the Save Output Data option is selected.
Input parameters: object
- An object containing the following keys:
-
type
, -
inputParams
, -
insuranceProductId
, -
contextType
, -
shouldSaveOutput
.
Output parameters: result
- The formula output result.
This script is called with a data object.
Based on the configured context type and underwriting type, this function calls either the testUnderwritting
or the testUnderwrittingProductCover
function - from the FTOS.IP_CALC.FormulaEngineHelper server automation script library.
Next, it receives the calculation results of the corresponding formula and saves the response in the FTOS_IP_TestScenarioOutput entity - if the Save Output Data option is selected.
Input parameters: object
- An object containing the following keys:
-
type
, -
inputParams
, -
insuranceProductId
, -
contextType
, -
shouldSaveOutput
.
Output parameters: result
- The formula output result.
Server Side Script Library
FTOS.IP_CALC.FormulaEngineHelper
This library is used to create test scenarios and test premium calculation and underwriting formulas. From this library, the following functions are used:
This function runs the formula based on the following input parameters:
Input parameters:
-
insuranceProductId
- The insurance product Id. -
insuranceProductFormulaId
- The insurance product formula Id. -
formulaInput
- The formula input.
Output parameters: formulaResult.Input
- The result after running the formula.
This function is meant to run the formula based on the following input parameters:
Input parameters:
-
insuranceProductId
- The insurance product Id. -
insuranceProductItemFormulaId
- The insurance product item (coverage) formula Id. -
formulaInput
- The formula input.
Output parameters: formulaResult.Input
- The result after running the formula.
This function is meant to run the formula based on the following input parameters:
Input parameters:
-
insuranceProductId
- The insurance product Id. -
contextType
- The context type. -
formulaInput
- The formula input.
Output parameters: formulaResult.Input
- the result after running the formula.
This function is meant to run the formula based on the following input parameters:
Input parameters:
-
insuranceProductId
- The insurance product item (coverage) Id. -
contextType
- The context type. -
formulaInput
- The formula input.
Output parameters: formulaResult.Input
- The result after running the formula.