Book a Demo

Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next

Running a Simulation

The process for running a simulation could not be easier - you simply choose the Play button on the DMN Simulation window or on the 'Run Simulation' panel, available from the Simulation ribbon. It is common practice to have the Decision Requirements diagram open, but even if it is not Enterprise Architect will launch the diagram, as it will be used as a canvas for describing the decision steps as articulated in the next section.

Whichever method you choose, the simulation will run to completion and the results - including intermediate decision steps and input data - will be annotated on the diagram. These annotations will be welcomed by decision modelers and other stakeholders as they allow these stakeholders to visualize the mechanics of how the simulation engine arrived at the final outputs.

In this diagram you can see that the decisions have been executed from the root level up to the trunk of the hierarchy, and the final output of the highest level decision is 'Declined' - meaning that the customer's application for finance has not been accepted.  Even in this relatively simplistic model it is useful to be able to see the intermediate decision output values (such as Affordability=4, Risk Assessment = High), but in a complex model it becomes critical to be able to visualize the steps that contribute to the final decision output. There are a number of scenarios where this information is important:

  • Incremental Development of the Model: including refactoring it after it has been deployed
  • Testing the Model: to ensure that it is generating the correct results with given data sets
  • Decision Explanation: including explaining to stakeholders such as customers how the decision was arrived at

Stepping through a Simulation

An even more effective facility is the ability to step through a simulation, allowing you to effectively look over the shoulder of the engine as it is performing the simulation. Again, this will be welcomed by modelers as it has the added benefit of highlighting the rules in the Decision Tables as they are invoked, thus allowing the simulation audience to see exactly which rules were fired to arrive at the output at each step during the execution.

It is a remarkably useful feature and it is amazing how many business logic errors can be picked up at this time, allowing the rules to be refined and honed so they are deemed complete and correct before they are put into a production system. To step through the simulation you must run the simulation to completion by clicking on the Play button, as indicated earlier. Once the simulation has been run,you can then select the 'Step' icon and the engine will start the simulation from the first step and pause before the second step, allowing you to view the results step-by-step. This diagram shows the diagram annotation after the first step:

And this diagram shows the data set that had been configured for the input data and that is being used for this step in the simulation:

This information is also annotated on the diagram and can be seen after every step of the simulation as the information on the diagram accumulates, as each step is run.

As you are stepping through the simulation, Enterprise Architect will display the selected rules in the expression editor and - in the case of a Decision Table - the rules that were fired will be highlighted in the table, allowing the simulation audience to see the rules clearly. The simulation will be paused at this point and will wait for you to click on the Step button again to resume the simulation.

The simulation can be continued step-by-step, and the input data, the selected rules and the diagram annotations can be viewed for each step in the paused state before moving on, until the final result is output for the highest level decision in the decision hierarchy.

In this diagram the affordability data has been input by the simulation engine, and this will be used to calculate whether the applicant can afford to service the loan.  We will see by the result in the next illustration what decision will be made.

You can continue stepping through the simulation, and now we will show the result for the highest level decision and the rule that was selected in the Decision Table.

The next diagram shows the final result of the simulation, and unfortunately the Applicant's finance application would be declined using the data sets provided. This is indicted by the final output annotation to the right of the Finance Application decision, which is the highest level decision in the hierarchy.