Literal Expression Simulation Example
The Business Knowledge Model (BKM) described in this section is available from the Model Wizard ( ). Select a host Package in your model, invoke the Model Wizard and - from the Perspectives drop-down menu - select 'Requirements | Decision Modeling'.
To access the example used in this section:
- Create a pattern for 'DMN Business Knowledge Model > Business Knowledge Model Literal Expression'
- Navigate in the Browser window to 'Business Knowledge Model Literal Expression > Payment'
It is also available in the Enterprise Architect Example model (EAExample):
- Navigate in the Browser window to 'Model Simulation > DMN Models > Business Knowledge Model > Business Knowledge Model Literal Expression'
Double-click on the 'Payment' element to open the BKM in the DMN Expression window.
Similar to a Decision table, the Business Knowledge Model implemented as a Boxed Expression can be tested as well.
Take the 'Payment' element as an example. 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:
Click on the Simulation button on the tool bar; this result is obtained:
The runtime parameter and return values will be displayed with an equals sign '=' followed by the runtime value. This value is also displayed as a label against the element on its parent diagram.
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.