Decision With BKM

The Decision With BKM pattern demonstrates how a decision 'requires' its inputs from structural Input Data and binds the value from the Input Data to a Business Knowledge Model (BKM). The BKM will evaluate a result and assign it to the decision.

Figure 1. A decision 'requires' Input Data and Invokes a BKM

Business Knowledge Model
In this example, we create a Business Knowledge Model Application risk score model, which is implemented as a Decision Table. The BKM defines three parameters Age, Marital Status, Employment Status and returns the accumulated (hit policy 'C+') score as the output Partial score.

Testing BKM
Before integrating the BKM into a decision hierarchy, it is good practice to test the BKM by providing some values. Activate the page Input Parameter Values for Simulation and provide values for the parameters:

Validate and Run. The simulation will be shown in the Expression View. The runtime value for the Input/Output Clause will be shown and the matching rule will be highlighted.

Information Requirement & Knowledge Requirement
The Decision Application risk score is implemented as an Invocation, binding values from Input data to the called BKM's parameters. We need to draw an Information Requirement connector from 'Input Data' to 'Decision', and draw a Knowledge Requirement connector from 'BKM' to 'Decision'.

Simulation
Create a DMNSimConfiguration element on the diagram, and double-click to open it in the DMN Simulation window. Set the 'Application risk score' 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 on both the diagram and 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.