BPMN Integrate with DMN Complete Example

The BPMN Integrate with DMN Complete Example pattern creates a Business Process diagram that models a Loan Application process.
•	Dependency connectors from a BPSim Artifact element to DMNSimConfiguration Artifact elements represent the usage relationships.EA allows a BPSim model to use multiple DMN models.

•	There are two ways to let BPSim expressions use DMN model: 
	- DMN's BusinessKnowledgeModel
	- DMN's InputData + Decision (demonstrated in this example)

•	The data used for BPSim simulation is provided by BPMN2.0::DataObject (as source of DataAssociation), stored in the Element's Notes. Each line is in the format of:
	DMN Artifact Name . DMN Input Data Leaf Component = Value
•	The use may generate the BPMN 2.0 DataObject from DMN Simulation window by either of the following ways:
	- Export one DMN Input Data to one BPMN DataObject
	- Export all DMN Input Datas (shown in the list) to one BPMN DataObject

•	The two BusinessRule tasks get the decision results from a DMN module. The result is assigned to properties defined in BPSim. When editing the Expression type of parameter value for BPSim Properties, the DMN Module's IntelliSense is supported. In this example, we composed "DMNSimArtifact.Get_Strategy()" for property "Strategy".

•	The BPSim properties are used in SequenceFlow's Condition Expression
BusinessTaskRule Decide bureau strategy is bind to decision Strategy in the DMN model

•	BusinessTaskRule Decide Routing is bind to decision Routing in the DMN model

Steps to simulate the BPMN model with DMN integration:
1. Ensure Java Environment. (install JDK and JRE)
2. Export DMN InputData to BPMN DataObject (this is already done if create  the pattern)
3. Generate DMN Module in Java Language from DMN Model.
3. Configure dependency connector from BPSim Artifact to DMNSimulation Artifact
4. Ensure the Expression Language for BPSim is set to Java (Not XPath)
5. Configure BPSim Property Parameters with DMN IntelliSense Support
6. Execute the simulation
Note: Steps 2, 3, 4, 5 are already configured if the model is exported from EA patterns.

How to Generate DMN Module in Java Language from DMN Module?
1.	Activate Generate Server page in the DMN Simulation Window
•	Specify a path to genrate DMN Module, the path could be any directory
Enter package name. if left as empty, com.sparxsystems.dmn will be used
Enter module name, the name should match the file name without extension
Click on the first button on the toolbar to add elements to generate

•	Choose Strategy and Routing in the Decision Section

•	Click OK and the selected decisions and all their dependencies will be added to the generation list.
Click Generate button

How to Integrate DMN Module in BPSim Artifact?
1.	Set the Expression Language to "Java".
Create a dependency connector from BPSim Artifact to DMNSimulation Artifact.
3. Configure "Decide bureau strategy" and "Decide Routing"
•	click "..." button for the property "Strategy", click the tab "Expression", the IntelliSense is supported by listing the BPSim Properties and DMN variables. 

The final configuration looks like this.

How to Generate/Update BPMN 2.0::DataObject ?
1.	Select DMN InputData and its dataset in the DMN Simulation window | Configure page

2. Click the 2nd or 3rd button from right on the toolbar to generate/update the BPMN2.0::DataObject. The user may choose to generate each DMN InputData to a BPMN2.0::DataObject or generate all DMN InputDatas to a single BPMN2.0::DataObject.
The Element Notes of BPMN2.0::DataObject will be updated to match the exported dataset.

The user may simulate DMN with a dataset, then immediately update it to BPMN DataObject to simulate the same data and DMN logic in a BPMN process. 
Optionally, the user may manually change the BPMN DataObject.
© 2000 - 2018  Sparx Systems Pty Ltd.  All rights Reserved.