xref: /plugin/bpmnio/test/data/dmn-test.txt (revision 43854469855b0d3261173416b47cbad6e62bc444)
1====== DMN Plugin Test Page ======
2
3This page tests the DMN.io plugin functionality.
4
5===== Simple DMN Decision Table =====
6
7<bpmnio type="dmn">
8<?xml version="1.0" encoding="UTF-8"?>
9<definitions
10    xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/"
11    xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/"
12    xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
13    xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
14    namespace="http://camunda.org/schema/1.0/dmn"
15    exporter="dmn-js (https://demo.bpmn.io/dmn)"
16    exporterVersion="17.0.2"
17    name="Add a DMN diagram">
18  <inputData id="dayType_id" name="Type of day">
19    <variable id="dayType_ii" name="Type of day" typeRef="string" />
20  </inputData>
21  <inputData id="temperature_id" name="Weather in Celsius">
22    <variable id="temperature_ii" name="Weather in Celsius" typeRef="number" />
23  </inputData>
24  <knowledgeSource id="host_ks" name="Host" />
25  <knowledgeSource id="guest_ks" name="Guest Type">
26    <authorityRequirement id="AuthorityRequirement_0vkhray">
27      <requiredDecision href="#guestCount" />
28    </authorityRequirement>
29  </knowledgeSource>
30  <businessKnowledgeModel id="elMenu" name="El menú" />
31  <decision id="dish-decision" name="Dish Decision">
32    <informationRequirement id="InformationRequirement_1d56kg6">
33      <requiredDecision href="#guestCount" />
34    </informationRequirement>
35    <informationRequirement id="InformationRequirement_11onl5b">
36      <requiredDecision href="#season" />
37    </informationRequirement>
38    <authorityRequirement id="AuthorityRequirement_142y75e">
39      <requiredAuthority href="#host_ks" />
40    </authorityRequirement>
41    <decisionTable id="dishDecisionTable">
42      <input id="seasonInput" label="Season">
43        <inputExpression id="seasonInputExpression" typeRef="string">
44          <text>season</text>
45        </inputExpression>
46      </input>
47      <input id="guestCountInput" label="How many guests">
48        <inputExpression id="guestCountInputExpression" typeRef="number">
49          <text>guestCount</text>
50        </inputExpression>
51      </input>
52      <output id="output1" label="Dish" name="desiredDish" typeRef="string" />
53      <rule id="row-495762709-1">
54        <inputEntry id="UnaryTests_1nxcsjr">
55          <text>"Winter"</text>
56        </inputEntry>
57        <inputEntry id="UnaryTests_1r9yorj">
58          <text>&lt;= 8</text>
59        </inputEntry>
60        <outputEntry id="LiteralExpression_1mtwzqz">
61          <text>"Spareribs"</text>
62        </outputEntry>
63      </rule>
64      <rule id="row-495762709-2">
65        <inputEntry id="UnaryTests_1lxjbif">
66          <text>"Winter"</text>
67        </inputEntry>
68        <inputEntry id="UnaryTests_0nhiedb">
69          <text>&gt; 8</text>
70        </inputEntry>
71        <outputEntry id="LiteralExpression_1h30r12">
72          <text>"Pasta"</text>
73        </outputEntry>
74      </rule>
75      <rule id="row-495762709-3">
76        <inputEntry id="UnaryTests_0ifgmfm">
77          <text>"Summer"</text>
78        </inputEntry>
79        <inputEntry id="UnaryTests_12cib9m">
80          <text>&gt; 10</text>
81        </inputEntry>
82        <outputEntry id="LiteralExpression_0wgaegy">
83          <text>"Light salad"</text>
84        </outputEntry>
85      </rule>
86      <rule id="row-495762709-7">
87        <inputEntry id="UnaryTests_0ozm9s7">
88          <text>"Summer"</text>
89        </inputEntry>
90        <inputEntry id="UnaryTests_0sesgov">
91          <text>&lt;= 10</text>
92        </inputEntry>
93        <outputEntry id="LiteralExpression_1dvc5x3">
94          <text>"Beans salad"</text>
95        </outputEntry>
96      </rule>
97      <rule id="row-445981423-3">
98        <inputEntry id="UnaryTests_1er0je1">
99          <text>"Spring"</text>
100        </inputEntry>
101        <inputEntry id="UnaryTests_1uzqner">
102          <text>&lt; 10</text>
103        </inputEntry>
104        <outputEntry id="LiteralExpression_1pxy4g1">
105          <text>"Stew"</text>
106        </outputEntry>
107      </rule>
108      <rule id="row-445981423-4">
109        <inputEntry id="UnaryTests_06or48g">
110          <text>"Spring"</text>
111        </inputEntry>
112        <inputEntry id="UnaryTests_0wa71sy">
113          <text>&gt;= 10</text>
114        </inputEntry>
115        <outputEntry id="LiteralExpression_09ggol9">
116          <text>"Steak"</text>
117        </outputEntry>
118      </rule>
119    </decisionTable>
120  </decision>
121  <decision id="season" name="Season decision">
122    <informationRequirement id="InformationRequirement_1sdwefx">
123      <requiredInput href="#temperature_id" />
124    </informationRequirement>
125    <decisionTable id="seasonDecisionTable">
126      <input id="temperatureInput" label="Weather in Celsius">
127        <inputExpression id="temperatureInputExpression" typeRef="number">
128          <text>temperature</text>
129        </inputExpression>
130      </input>
131      <output id="seasonOutput" label="season" name="season" typeRef="string" />
132      <rule id="row-495762709-5">
133        <inputEntry id="UnaryTests_1fd0eqo">
134          <text>&gt;30</text>
135        </inputEntry>
136        <outputEntry id="LiteralExpression_0l98klb">
137          <text>"Summer"</text>
138        </outputEntry>
139      </rule>
140      <rule id="row-495762709-6">
141        <inputEntry id="UnaryTests_1nz6at2">
142          <text>&lt;10</text>
143        </inputEntry>
144        <outputEntry id="LiteralExpression_08moy1k">
145          <text>"Winter"</text>
146        </outputEntry>
147      </rule>
148      <rule id="row-445981423-2">
149        <inputEntry id="UnaryTests_1a0imxy">
150          <text>[10..30]</text>
151        </inputEntry>
152        <outputEntry id="LiteralExpression_1poftw4">
153          <text>"Spring"</text>
154        </outputEntry>
155      </rule>
156    </decisionTable>
157  </decision>
158  <decision id="guestCount" name="Guest Count">
159    <informationRequirement id="InformationRequirement_0j60f3j">
160      <requiredInput href="#dayType_id" />
161    </informationRequirement>
162    <knowledgeRequirement id="KnowledgeRequirement_0n56cqb">
163      <requiredKnowledge href="#elMenu" />
164    </knowledgeRequirement>
165    <decisionTable id="guestCountDecisionTable">
166      <input id="typeOfDayInput" label="Type of day">
167        <inputExpression id="typeOfDayInputExpression" typeRef="string">
168          <text>dayType</text>
169        </inputExpression>
170      </input>
171      <output id="guestCountOutput" label="Guest count" name="guestCount" typeRef="number" />
172      <rule id="row-495762709-8">
173        <inputEntry id="UnaryTests_0l72u8n">
174          <text>"Weekday"</text>
175        </inputEntry>
176        <outputEntry id="LiteralExpression_0wuwqaz">
177          <text>4</text>
178        </outputEntry>
179      </rule>
180      <rule id="row-495762709-9">
181        <inputEntry id="UnaryTests_03a73o9">
182          <text>"Holiday"</text>
183        </inputEntry>
184        <outputEntry id="LiteralExpression_1whn119">
185          <text>10</text>
186        </outputEntry>
187      </rule>
188      <rule id="row-495762709-10">
189        <inputEntry id="UnaryTests_12tygwt">
190          <text>"Weekend"</text>
191        </inputEntry>
192        <outputEntry id="LiteralExpression_1b5k9t8">
193          <text>15</text>
194        </outputEntry>
195      </rule>
196    </decisionTable>
197  </decision>
198  <textAnnotation id="TextAnnotation_1">
199    <text>Week day or week end</text>
200  </textAnnotation>
201  <association id="Association_18hoj4i">
202    <sourceRef href="#dayType_id" />
203    <targetRef href="#TextAnnotation_1" />
204  </association>
205  <dmndi:DMNDI>
206    <dmndi:DMNDiagram id="DMNDiagram_05sfxgt">
207      <dmndi:DMNShape id="DMNShape_1nkrqp5" dmnElementRef="dayType_id">
208        <dc:Bounds height="45" width="125" x="417" y="377" />
209      </dmndi:DMNShape>
210      <dmndi:DMNShape id="DMNShape_0wgwr3t" dmnElementRef="temperature_id">
211        <dc:Bounds height="45" width="125" x="188" y="377" />
212      </dmndi:DMNShape>
213      <dmndi:DMNShape id="DMNShape_17n98pm" dmnElementRef="host_ks">
214        <dc:Bounds height="63" width="100" x="646" y="48" />
215      </dmndi:DMNShape>
216      <dmndi:DMNShape id="DMNShape_1i9incu" dmnElementRef="guest_ks">
217        <dc:Bounds height="63" width="100" x="660" y="198" />
218      </dmndi:DMNShape>
219      <dmndi:DMNEdge id="DMNEdge_0tdfvdg" dmnElementRef="AuthorityRequirement_0vkhray">
220        <di:waypoint x="570" y="245" />
221        <di:waypoint x="660" y="235" />
222      </dmndi:DMNEdge>
223      <dmndi:DMNShape id="DMNShape_1uo50vq" dmnElementRef="elMenu">
224        <dc:Bounds height="46" width="135" x="642" y="307" />
225      </dmndi:DMNShape>
226      <dmndi:DMNShape id="DMNShape_0s7a8pk" dmnElementRef="dish-decision">
227        <dc:Bounds height="80" width="180" x="301" y="48" />
228      </dmndi:DMNShape>
229      <dmndi:DMNEdge id="DMNEdge_1cvfntf" dmnElementRef="InformationRequirement_1d56kg6">
230        <di:waypoint x="480" y="210" />
231        <di:waypoint x="421" y="148" />
232        <di:waypoint x="421" y="128" />
233      </dmndi:DMNEdge>
234      <dmndi:DMNEdge id="DMNEdge_0djoiii" dmnElementRef="InformationRequirement_11onl5b">
235        <di:waypoint x="251" y="210" />
236        <di:waypoint x="361" y="148" />
237        <di:waypoint x="361" y="128" />
238      </dmndi:DMNEdge>
239      <dmndi:DMNEdge id="DMNEdge_0qqxexx" dmnElementRef="AuthorityRequirement_142y75e">
240        <di:waypoint x="646" y="81" />
241        <di:waypoint x="481" y="86" />
242      </dmndi:DMNEdge>
243      <dmndi:DMNShape id="DMNShape_06z5z89" dmnElementRef="season">
244        <dc:Bounds height="80" width="180" x="161" y="210" />
245      </dmndi:DMNShape>
246      <dmndi:DMNEdge id="DMNEdge_1383eyj" dmnElementRef="InformationRequirement_1sdwefx">
247        <di:waypoint x="251" y="377" />
248        <di:waypoint x="251" y="310" />
249        <di:waypoint x="251" y="290" />
250      </dmndi:DMNEdge>
251      <dmndi:DMNShape id="DMNShape_0qbhe8q" dmnElementRef="guestCount">
252        <dc:Bounds height="80" width="180" x="390" y="210" />
253      </dmndi:DMNShape>
254      <dmndi:DMNEdge id="DMNEdge_131oa1j" dmnElementRef="KnowledgeRequirement_0n56cqb">
255        <di:waypoint x="691" y="307" />
256        <di:waypoint x="570" y="262" />
257      </dmndi:DMNEdge>
258      <dmndi:DMNEdge id="DMNEdge_1avtdb1" dmnElementRef="InformationRequirement_0j60f3j">
259        <di:waypoint x="480" y="377" />
260        <di:waypoint x="480" y="310" />
261        <di:waypoint x="480" y="290" />
262      </dmndi:DMNEdge>
263      <dmndi:DMNShape id="DMNShape_0bblyhb" dmnElementRef="TextAnnotation_1">
264        <dc:Bounds height="45" width="125" x="328" y="477" />
265      </dmndi:DMNShape>
266      <dmndi:DMNEdge id="DMNEdge_0aqnkob" dmnElementRef="Association_18hoj4i">
267        <di:waypoint x="480" y="422" />
268        <di:waypoint x="391" y="477" />
269      </dmndi:DMNEdge>
270    </dmndi:DMNDiagram>
271  </dmndi:DMNDI>
272</definitions>
273</bpmnio>
274===== Test Instructions =====
275
2761. The DMN decision table above should render using the dmn.io viewer
2772. You should be able to see the decision logic clearly
2783. The table should show input/output columns with rules