Prev Next

Example - Loan Repayment

This Business Knowledge Model (BKM) Payment_2_decimal is implemented as a Literal Expression.

A DMN example of Business Knowledge Model (BKM), implemented as Literal Expression using Sparx Systems Enterprise Architect.

  • The BKM defines three parameters: Rate, Term and Principle

Set the values for the Input Parameters and evaluate the model:

A DMN Expression showing the resulting simulation run-time values using Sparx Systems Enterprise Architect.

  • 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

A DMN example of inputting Parameter Values for a Literal Expression using Sparx Systems Enterprise Architect.

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:

A DMN Expression using Boxed Content as modeled in Sparx Systems Enterprise Architect.

  • 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:

The results of DMN Expression using Boxed Content as modeled in Sparx Systems Enterprise Architect.