Prev | Next |
Simulate DMN Model
A DMNSimConfiguration Artifact contains information to simulate a DMN model depicted by Decision Requirements diagrams.
Access
Ribbon |
Simulate > Decision Analysis > DMN > Open DMN Simulation | Simulate Page |
Other |
Double-click on a DMNSimConfiguration element |Simulate Page |
DMNSimConfiguration Artifact
To create a DMNSimConfiguration element:
- Open a Decision Requirements Diagram
- Drag the DMNSimConfiguration element from the toolbox onto the diagram
By default, all DMN elements in the current Package (Decision, BusinessKnowledgeModel, InputData ItemDefinition) will be loaded to the Simulation window.
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
Simulation run and stepping through
You can perform a full run of the simulation using the icon. You can step into each Decision to see the invocation sequence using the
icon.
For example in the above diagram:
- Decision 'Pre-bureau affordability' invokes BusinessKnowledgeModel 'Affordability calculation'
- BusinessKnowledgeModel 'Affordability calculation' further invokes another BusinessKnowledgeModel 'Credit contingency factor table'
Decision List
When a Package is loaded, a Decision Requirements Graph (DRG) and decision dependency list is created. The DMN InformationRequirement connectors determine the List order.
- All the decisions will be listed in the 'Target Decision' combo box
DataSet & Input Data
When the Target Decision is selected, all the dependent InputDatas are added to the list. You can then choose a dataset for simulation from the list of datasets defined in an InputData Element:
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
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'.
- 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.
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.