Creating and editing DMN diagrams
- Open the Explorer and select New - Business Decision Diagram (DMN 1.0):
- Once you have created or opened a DMN diagram, you can drag and drop an element from the shape repository on the left onto the canvas:
- You can also use the interactive context menu of an already existing element to create new DMN elements.
- Label the element.
- Add attributes to the element. A decision can typically be described by a question - answer scheme. By default, there are attributes on decision element level for documenting this scheme for each decision:
- To save the diagram, click the Save button in the upper left corner of the Editor.
Copying elements and element groups
For faster modeling, it can be helpful to copy elements or interconnected element groups. If you copy an interconnected group of DMN elements in the Editor contained decision tables and attributes are copied as well.
In our example, we determine a customer discount and subsequently calculate the purchase price of products with an additional discount and normally priced products separately to be able to have the values displayed separately on the bill:
These elements are almost identical and can be copied during the modeling process to save time. As both 'Product value' input elements have the same input range, only the label has to be altered here.
- To copy elements, select them, then click the Copy button.
- Then click the Paste button in the Editor's toolbar.
- Now, rearrange the elements as needed and alter decisions and names, then connect them to other elements if necessary.
You can also copy elements from one diagram to another. For this, we recommend you to open the corresponding diagrams in different browser tabs. This procedure is especially helpful when you split one complex model into multiple, better understandable parts.
Creating complex input data elements
In many cases, it is impractical to model each data input parameter as a separate element.
Instead, you can create complex data input elements.
For example, the Data Input element Order can contain the attributes Purchase value and Customer status.
- To configure a data input element as complex, set the value of the attribute Type definition to Complex type:
- Now, click the Edit button next to Attribute to open the configuration dialog.
- In the configuration dialog, you can add attributes and define their properties. For each attribute, you need to define the name and the type. Depending on the type, you can define further properties.
- Click Save to confirm the changes.
- After configuring the complex input data element, the attributes are available in the Decision Table editor, for example as `Order.Purchase value`:
Creating sub decisions
In many situations, a decision depends on one or multiple sub decisions. In such a case, you can daisy-chain decision elements or transform Data Input elements into Decisions as depicted below:
In case you transform a data input, a new data input is automatically created and attached to the sub decision:
In our example, when opening the Decision Table, its output is already defined. All you need to do is create possible additional inputs and map them to output values.
Multi Instance Decisions
Multi instance decisions (an extension of the DMN standard) are (sub)decisions, which are executed several times (once per entry/object of a list) and serve as data input for a higher level decision. Multi instance decisions are similar to a for-loop in a computer program.
In the example below, each position of the purchase agreement is validated to determine the validity of the entire agreement.
In this sample the decision is made for each position.
To create a multi instance decision, proceed as follows:
- Select DMN 1.0 (Complete) from the shape repository.
- Click Multi Instance Decision and drag the element onto the canvas.
- Reference a list of data inputs, or a data input object that contains such a list.
- Define the internal decision logic of the multi instance decision. The referenced objects are no lists.
- Open the configuration dialog of the Iteration attribute to configure the multi instance decision.
- Specify the input list and aggregation function.
- In our example, all positions have to be valid.
- Finally, the multi instance decision can be referenced by a higher level decision.
Linking BPMN diagrams to DMN diagrams
- Once you have created the Task in the BPMN diagram, change the Task type to Business Rule.
- Now, select the attribute Decision reference:
- Alternatively, you can click the arrow in the upper left corner of the Task. The dialog Establish link opens.
- You can either create a new DMN diagram or link an already existing one.