Create a Complex Formula

A business process involves calculating the sum of money to pay and to be paid for a service. Formulas process different inputs from your digital journeys in order to generate desired outputs. It is mainly used to define mathematical and logical calculations that support various business needs.

Task at hand

The use-case is to create a formula with several arguments. The arguments are the following:

  • Construction Type;
  • Appendages: warehouse, garage, shed, stable, swimming pool, sauna or storage room;

  • Construction Year;
  • Seismic Zone;
  • Risks.

The steps is to return the result. The formula is the following:

Copy
result = Risks * Construction Year * Seismic Zone * Construction Type * Appendages;
 

The risks included in the insurance are:

  • Hail, storm, storm, avalanche or snow
  • Earthquake, floods, landslides
  • Fire, lightning, explosion, floods caused by installations
  • Theft, vandalism, disposable property
  • Falling bodies from outside, floods caused by neighbours
  • Accommodation and rent costs in a temporary home
  • Reconstruction project costs
  • Costs for expertise and damage assessments.

Before you begin

  • Create an entity with the attributes that match the list of arguments above.
  • Create a home insurance data model and journey.
  • Expose the journey in the FintechOS Portal.

1 Import the data sets

Follow the path: FintechOS Studio > Fintech Automation> Business Formula > Data sets.

For each of the arguments create a data set.

Construction type

Construction type

Material

Dimensions

Coefficient
house     woodunder 150 square meters1
 over 150 square meters2
brickunder 150 square meters3
 over 150 square meters4
cementunder 150 square meters5
 over 150 square meters6
apartment     woodunder 100 square meters7
 over 100 square meters8
brick

under 100 square meters

9
 over 100 square meters10
cementunder 100 square meters11
 over 100 square meters12
villa     woodunder 180 square meters13
 over 180 square meters14
brickunder 180 square meters15
 over 180 square meters16
cementunder 180 square meters17

 

over 180 square meters18
holiday home     woodunder 100 square meters19

 

over 100 square meters20
brickunder 100 square meters21

 

over 100 square meters22
cementunder 100 square meters23

 

over 100 square meters24
 

Appendages

AppendagesCoefficient
warehouse25
garage26

shed

27

stable

28

swimming pool

29

sauna

30

storage room

31

Construction Year

Construction yearCoefficient
1970-198032
1980-199033
1990-200034
2000-201035
2010-202536
 

Seismic Zone

Seismic ZoneCoefficient
Class I37
Class II38
Class III39
No risk40
 

To import the .xml files, click the Insert files.

Data setDetails

Name

Insert the name for each data set, e.g. Data_Set1.

Display Name

Insert a display name.
DescriptionInsert a description.
Value typesSelect numeric.
Single valueThe boolean is true.
Return Default ValueThe boolean is true.

Ignore Empty Values

The boolean is true.

Start Date

The present date is the start date.

End Date

The end date is 25/02/2050.

Has Column Description

The boolean is true.

Has Row Description

The boolean is false.

Version

It is automatically true.

Click the Insert button at the top right-hand corner of the page.

Enter a Name for the data set, e.g. Insurance_Home. Enter a Description for the data set, e.g. demo_trail.

In the Value Types field, select if the data set returns Numeric.

Check the Single Value box because the data set includes a mapping between a single discriminant key and a single metric value.

Select the Start Date, e.g. 10th of March 2021, time 10 a.m. The End Date and Version fields are populated automatically based on the data set's versioning.

Tick the Has Column Description and Has Row Description checkboxes because there is field descriptions in the second row and/or second column.

Click the Save and Reload button.

For details, see Data Sets.

2 Add the arguments

Follow the path: FintechOS Studio > Fintech Automation> Business Formula > Formula Input.

Insert a name and description, e.g. Home_Insurance.

Click the Insert button to add an argument.

ArgumentDetails
NameInsert the name for each argument:
  • Construction Type,
  • Appendages
  • Construction Year,
  • Seismic Zone,
  • Risks,
  • Insured Amount.
Display NameInsert a display name.
Formula InputThis field is automatically filled in, in this case, Home_Insurance.
Master TypeSelect Single type.
Formula Argument Sub-TypeSelect whole number.
 

Click the Save and reload button. Repeat six times.

For details, see Define Formula Inputs.

3 Create the formula itself

Follow the path: FintechOS Studio > Fintech Automation> Business Formula > Formula.

Click the Insert button on the right-hand corner of the screen to add a new formula. Fill in the following:

FieldDetails
NameInsert the name, e.g. Home_Insurance_Formula.
Start dateAutomatically the current date and hour are registered, but can be changed.
Formula InputSelect from the drop-down list the input (arguments' list) created earlier.
End dateIt is read-only, automatically filled in by the system after save.
VersionIt is read-only, automatically filled in by the system.
 

Click the Save and reload button. For details, see Define Formula.

4 Create the formula step

Insert a name for the formula step.

In this case, we only have one step to create. Insert the following formula:

Copy
result = Risks * Construction Year * Seismic Zone * Construction Type * Appendages;
 

Click the Save and close button.

IMPORTANT!  
Activate the formula to use it in a digital journey!

5 Test the formula

Insert a suggestive name for the test, e.g. HomeInsuranceTest.

Select a reference date, e.g. 25 of March 2021.

Click the Save and reload button.

Insert the input.

Click the button Test formula.

5 Map the formula

Follow the path: FintechOS Studio > Fintech Automation> Business Formula > Formula Parameter mapping.

Click the Insert button and fill in the following:

FieldDetails
Data mapping typeSelect formula from the list.
Master entitySelect the entity used in the form driven flow.
Operation nameSelect the active formula created earlier.
NameThe name is automatically generated.

Click the Save and reload button.

Input

Output

The attributes shown here must be whole number.

For details, see Formula Parameter Mapping.

6 Call the formula no-code in a journey

Follow the path: FintechOS Studio > Digital Journey > Form Driven Flows.

Access from the list the form driven flow for the Home Insurance. Navigate to the Actions tab.

In the Form Actions grid, click the Insert button.

Insert a name for the action, e.g. Call formula. Add the Call formula mapping and map the data.

Add the action to any step you wish. For details, see Calling Formula Engine No-Code.

Congratulations! You have created a calculation to use in your digital journey!