Decision With Input Data

The Decision With Input Data pattern demonstrates how a decision 'requires' its inputs from a structural Input Data and uses the instance in the expressions.

Figure 1. A decision 'requires' an Input Data

Item Definition & Input Data
Each Input Data element must specify a type for an Item Definition. An Item Definition could be either set to a simple type or composite other Item Definitions.

Item Definition Applicant Data Definition composites two other Item Definitions Application Risk Score and Existing Customer, with the types number and boolean respectively.

Input Data Applicant Data sets the type for Applicant Data Definition, and the values 100 and true are provided for Application Risk Score and Existing Customer respectively.

Decision
In this example, the Decision is implemented as a Decision Table with two input clauses and one output clause. The input expression is referring to the Input Data instance. 
Note: The expression can access the 'leaf' component of the Input Data.

Simulation
Create a DMNSimConfiguration element on the diagram, and double-click on it to open it in the DMN Simulation window. Set Bureau call type as the Target Decision; the required Input Data will be automatically loaded.  You can specify a Data Set to simulate the model.

Validate and Run; the simulation result will be shown both on the diagram and in the Simulation window.

The runtime result for each decision is shown on the diagram:

The runtime simulation result is shown on the Simulation window.

If we click on the 'Step' button, the Decision Table will show the input and output runtime values and highlight the matching rule.