Prev Next

Literal Expression Simulaton Example

The Business Knowledge Model (BKM) described in this section is available from the Model Wizard (Ctrl+Shift+M). In the Perspectives select the Requirements | Decision Modeling.

  • Create the pattern for 'DMN Business Knowledge Model | Business Knowledge Model Literal Expression'
  • Navigate in the Browser window to 'Business Knowledge Model Literal Expression | Payment'

Double-click on the 'Payment' element to open the BKM in the DMN Expression window

Similar to Decision table, the Business Knowledge Model implemented as a Boxed Expression can be tested as well.

Take this 'Payment_2_decimal' BKM as an example:

An example of a DMN Boxed Context /Literal Expression in a Business Knowledge Model implemented using Sparx Systems Enterprise Architect.

This BKM will calculate the monthly repayment based on interest rate, number of terms and principal amount.

We could provide test values such as these:

An example using Input Parameters in a DMN Literal Expression inside a Business Knowledge Model using Sparx Systems Enterprise Architect.

Click on the Simulation button on the tool bar; this result is obtained:

An example of a Simulation run of a DMN Business Knowledge Model using Sparx Systems Enterprise Architect.

The runtime parameter and return value will be displayed with an equals sign '=', followed by the runtime value.

In this example, given an annual Rate of 4% for 30 years and a principal of $300,000, the monthly repayment is $1,432.25

Note: The DMN Library already has a PMT function defined; this example mainly demonstrates how Literal Expression works and how to test it with a set of arguments.