Prev Next

DMN Simulation

After a Decision Model is created, the user may configure a DMN Simulation artifact and Validate/Run/Step/Debug the model.

By switching data sets, the user may do what-if analysis to ensure the model meet the requirement of business.

The user may also generate code for  the DMN Server. Currently, 4 languages are supported:  Java/JavaScript/C++/C#.

In order to simulate BPMN and DMN together, EA's BPSim Execution Engine accept a DMN Server in Java language. Before the BPSim Execution engine execute, we need to ensure the DMN Server is tested. Luckily, we can Run/Debug the testing for Java DMN Server easily in EA.

Configure DMN Simulation

  • Create a DMNSimConfiguration element in a package, double click to open it. Then 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. (E.g. We chose Dataset "Income 5000" for InputData "Applicant data"; chose "default" for InputData "Requested product")

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 the "Run" button will evaluate all the decison values based on the values for input datas.
  • Click the "Step" button will evaluate a single decision and the user can watch the DMN Expression window, which clearly showed 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.

In this example, decision "Eligibility" returns a string "ELIGIBLE". Decision "Eligibility" invokes BusinessKnowledgeModel "Eligibility rules" by binding the parameters:

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

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 pecify 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.