Example: Integrate DMN Business Knowledge Model into BPSim Property Parameter
In some cases, you might want just to design a Decision Table to use in a BPMN model. If so, there is no need to go through the processes of creating a Decision Service, Decision, Input Data or even Item Definition, as a Business Knowledge Model (BKM) can be directly interfaced.
An example of integrating a DMN BKM into the BPSim model is provided in the Model Wizard for BPSim.
To access this:
- Set the Perspective to Business Modeling > BPSim
- Open the Model Wizard ( )
- Select BPMN Integrate with DMN - Delivery Cost Calculation
- Click on the
- Create a simple Business Knowledge Model as a Decision Table (you can also create other expressions such as boxed context or literal expressions) with parameters, then model the logic (input clause, output clause, rules) and test it (the 'Input Parameter Values for Simulation' tab on the DMN Expression window).
- Connect the BKM to a Decision with a Knowledge Requirement connector. This Decision serves as a group name for a number of BKM functions; you can simply input a number such as '10' to the expression. For example, if you want to generate Java code with only five BKMs (considering your model might have over one hundred BKMs), you can connect these five BKMs to a Decision and select this Decision in the DMN Simulation window, then all five BKMs will be included automatically.
- Generate Java code and (assuming everything is correct) the compile will be successful.
- In the BPSim configuration, we simply use Intelli-sense to construct the expression for task 'Compute Delivery cost'.
In this example, the 'Generate furniture picture and weight' task will generate random values to the properties 'Weight' and 'Price', then the 'Compute Delivery cost' task will pass the value to the Business Knowledge Model and the result will be carried back to the property 'DeliveryCost'.
You can now execute the simulation, and step through the debug process to observe, for example, the attribute value changes.