Prev | Next |
Example - Loan Repayment
This Business Knowledge Model (BKM) Payment is implemented as a Literal Expression.
- The BKM defines three parameters: Rate, Term and Principle
Set the values for the Input Parameters and evaluate the model:
- The runtime parameter value will be displayed; for example, Rate = 00.005
- The BKM's result will be evaluated by the literal expression and the value is displayed on the declaration line; for example, return = 1798.65
Although the formula for this can be written in one line, it is quite complicated. We can re-factor this model with Built-In function and Boxed Context to improve readability:
- The Boxed Context defines two variable-expression paired entries; these variables serve as 'local variables', which can be used in later expressions
- Return value: the expression can use the value of 'local variables'
- Any expressions in a Boxed Context can use built-in functions that are defined in the customizable Template — DMN Library; for example, functions PMT(...) and decimal(...) are used in this example
The simulation result is exactly the same as a Literal Expression: