Calculated information can never be edited by a user. It is recalculated each time something changes in the information fields it uses as source.
When configuring a piece of information, you are asked whether it is calculated information or not. If you set this to Yes, a field with two extra options appears:
Using RuLa, write the formula that will calculate the value of the information as a single expression.
Display calculated information?
Yes: this information will be displayed in the case.
No: the information is still calculated and can be used in the process, but will not be displayed in the case manager.
A calculated information consists only of an expression that defines the output of the calculated information. It has to follow the output type of the information. Inside the expression you can access information of the instance the calculated information is connected to with
A person's name can be split over three different information fields:
However, you also want one field on the document to contain the full name. To get this, attach this condition to the calculated information field
CONCAT(self.first_name, " ", self.middle_name, " ", self.last_name)
This takes the data of the three fields listed above, inserts a space between each value, and combines them as a single new value of the field
Whenever the information in any or all of the three individual fields is changed, the information in the field
full_name will be recalculated accordingly.
Based upon information on a person's wealth, a bank wants to calculate whether or not additional checks are required.
The condition that calculates whether the qualification 'High or Suspect Wealth' is relevant could be:
self.total_wealth > 2000000orself.source_of_wealth contains other
Line 1 and 3 are expressions, that take in values from the fields
self.source_of_wealth. The operator
or that separates the expressions, implies that only one of them has to be 'true' for the entire condition to evaluate to 'true'.
If the person in the case holds a total wealth of over two million, according to the information given in the field
self.total _wealth, or if the field
self.source_of_wealth contains 'other', next to for example 'employment' and 'investments', the calculated information field 'High or Suspect Wealth' evaluates as 'true'.
Average revenue (Number)
There can be good reasons to want to calculate the expected revenue of a corporate client for 2021, based on the averages of that company's revenue over the years 2018, 2019, and 2020. For example to decide on a loan the company is applying for.
The revenue over the past three years is collected in separate information fields, for example:
You create a new information piece,
self.expected_revenue, that holds the expected revenue for the following year by calculating the average of the values from the three fields listed above. You can get that by writing the following formula in the condition field for
AVG(self.revenue_2018, self.revenue_2019, self.revenue_2020)
In the configuration of the information
self.expected_revenue, set a number variant as the output type.
A bank could determine the number or level of services offered to a client, based on that client's annual income. The bank has four service levels on offer: bronze, silver, gold, and platinum. What level a client falls into, is calculated from the annual income. In other words:
service_level is calculated from the information
annual_income. Up to an income of 150,000 the client is offered the bronze service level. With an income between 150,000 and 500,000 the silver level is offered, gold for incomes between 500,000 and 1,000,000 and platinum for incomes of over a million.
The condition field for information service_level should read:
casewhen self.annual_income <= 150000 then bronzewhen self.annual_income <= 500000 then silverwhen self.annual_income <= 1000000 then goldelse platinumend