Prev Next

Simulate DMN Model

A DMNSimConfiguration Artifact contains information to simulate a DMN model depicted by Decision Requirements diagrams.



Simulate > Decision Analysis > DMN > Open DMN Simulation | Simulate Page


Double-click on a DMNSimConfiguration element |Simulate Page

Toolbar Options



See also

Click on this button to validate all the dependent DMN elements based on the Target Decision.

Note: A Decision/BusinessKnowledgeModel/InputData/ItemDefinition that is on the Target Decision hierarchy will not be considered. For example, you have some unfinished Decision elements in the Package; as they have no relationship to the Target Decision, they will not impact the simulation.

DMN Decision Table Validation

Click on this button to execute the decision hierarchy in order. The results will be represented on the diagram and shown in the 'Runtime values' column.

Click on this button to step through the decision hierarchy in order. One click will evaluate one decision element. With this feature, you will be able to see the decision-making process; the decision logic and runtime values will be displayed clearly in the DMN Expression window.

Click on this button to exit the simulation mode.

Simulation Overview

When a Target Decision is specified, the 'Simulation' page will be filled with the decisions, in dependency order.

When Executing or Stepping Through the Decision Hierarchy, the decisions will be evaluated in order:

  • The runtime result will be showing in the Decision row
  • The runtime result will be displayed on the diagram
  • The decision logic and input/output data will be presented in the DMN Expression window

An example of a running DMN simulation showing the runtime results of the simulation using Sparx Systems Enterprise Architect.

Invocation Hierarchy

You can expand the Decision in the list to see the invocation hierarchy.

When running a DMN simulation the Decision can be expanded to see the invocation hierarchy using Enterprise Architect.

For example:

  • Decision 'Pre-bureau affordability' invokes BusinessKnowledgeModel 'Affordability calculation'
  • BusinessKnowledgeModel 'Affordability calculation' further invokes another BusinessKnowledgeModel 'Credit contingency factor table'

Advanced Debugging

Although Enterprise Architect provides a validation feature to help you locate many modeling issues and DMN expression issues, the simulation might still fail (rarely but possible) due to uncaught issues.

However, Enterprise Architect provides the ability to debug the code that is running behind the simulation. You can also modify the code and run it in cycles until the issue is found and fixed.

The Execute button on the toolbar displays a menu with these options:

  • Generate New Script (Scripting Window)
  • Update Selected Script (Scripting Window)
  • Run Selected Script (Scripting Window)
  • Edit DMN Template

If you select 'Generate New Script (Scripting Window), the Scripting window displays showing a script created in a Package named 'DMN'.

An example of expanding the view of the Invocation Hierarchy in a DMN Simulation run using Sparx Systems Enterprise Architect.

  • The default script name is composed of these parameters: 'ArtifactName - TargetDecision - InputData1(DataSet)_ InputData2(DataSet)_...'

Double-click on this file to open it in the Enterprise Architect Script editor, set a breakpoint, and debug the file.

View showng in the Scripting window the location of the script generated for the DMN simulation in Sparx Systems Enterprise Architect.

By selecting the script in the Scripting Window, and if the script matches the model (by the 'Simulation Script Identifier' in the script), you enable the menu option 'Run Selected Script'.

You can customize the DMN Template to generate the correct script for simulation.

Learn more