Prev Next

DMN Simulation

After a Decision Model is created, you can configure a DMN Simulation Artifact and Validate, Run, Step Through or Debug the model.

By switching data sets, you can do what-if analysis to ensure the model meets the requirements of the business.

You can also generate code for the DMN Server. Currently, four languages are supported: Java, JavaScript, C++ and C#.

In order to simulate BPMN and DMN together, Enterprise Architect's BPSim Execution Engine accepts a DMN Server in Java language. Before the BPSim Execution Engine executes, ensure that the DMN Server is tested. Luckily, we can Run or Debug the testing for the Java DMN Server easily in Enterprise Architect.

Configure DMN Simulation

  • Create a DMNSimConfiguration element in a Package and double-click on it to open it; all DMN elements in this Package (Decision, BusinessKnowledgeModel, InputData ItemDefinition) will be loaded to the Simulation window
  • The 'Target Decision' combo box will be filled with all the decisions; choose a target decision - the dependent InputDatas will be filled in the list
  • Choose a defined dataset by clicking on the Dataset cell in the list (for example, choose Dataset 'Income 5000' for InputData 'Applicant data'; choose 'default' for InputData 'Requested product')

Choosing a Target Decision when running a DMN simulation using Sparx Systems Enterprise Architect.

Simulate DMN Model

  • When a Target Decision is specified, the 'Simulation' page will be filled with the decisions, in dependency order
  • Each decision row can be expanded to show the invoked BusinessKnowledgeModel
  • Click on the Run button to evaluate all the decision values based on the values for Input Data
  • Click on the Step button to evaluate a single decision and watch the DMN Expression window, which clearly shows the input value for the decision and output based on the input; the diagram containing the decision hierarchy will highlight the executed decisions and show the runtime results on a label

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

In this example, the decision 'Eligibility' returns a string 'ELIGIBLE' and invokes BusinessKnowledgeModel 'Eligibility rules' by binding the parameters as shown:

  • Bind 'Pre-Bureau Affordability' to the dependent decision 'Pre-bureau affordability' (runtime value: True)
  • Bind 'Pre-Bureau Risk Category' to the dependent decision 'Pre-bureau risk category' (runtime value: VERY LOW)
  • Bind 'Age' to the field 'Age' in dependent input data 'Applicant data' (runtime value: 40)

An example DMN Expression in a Business Knowledge Model using Sparx Systems Enterprise Architect.

The BusinessKnowledgeModel 'Eligibility rules' has a Hit Policy P (Priority), meaning that multiple rules can match, but only one hit should be returned; the ordering of the list of output values is used to specify the (decreasing) priority.

In this run time case ('Pre-Bureau Affordability' = true, 'Pre-Bureau Risk Category' = VERY LOW, 'Age' = 40), only one rule with output 'ELIGIBLE' matches.