I am just getting started with Decision Management Notation (DMN), using a free trial of Trisotech DMN which in general terms I am liking a lot. I am waiting to receive the Silver book DMN Method and Style from Amazon but its not here yet and not sure if it will cover this question:
I can't really overcome what appears to me to be a basic issue. Maybe I am just not grasping some fundamental comments. representing the aggregation of list data in an elegant way...similar to how I would do it in SQL
If I have athletics high jump event data:
Results
Competitor |
Attempt |
Height |
a |
1 |
170 |
a |
2 |
185 |
a |
3 |
165 |
b |
1 |
128 |
b |
2 |
180 |
b |
3 |
190 |
c etc |
0 |
0 |
In MS Access SQL, to generate the ranked list of winners
SELECT Results.Competitor, Max(Results.Height) AS MaxOfHeight
FROM Results
GROUP BY Results.Competitor
ORDER BY Max(Results.Height) DESC;
To represent this in DMN, intuitively I am thinking I might create a data type called 'Results', with three fields, and then assign that to an Input Data Input object. I would then link that Data Input object to a Decision Object and write some similar code to the SQL
Is this the way I should be thinking about grouping/aggregating list data?
I don't know if the XML will mean anything to anyone but this is my effort so far, including me trying to add some 'pseudocode' expression to match the SQL
</semantic:itemDefinition>
<semantic:inputData id="_a14bfe06-7b6c-4827-bcb8-7365ceb6f0b2" name="">
<semantic:variable id="_d1cad4e8-dd84-4db6-885e-386853614322" name="" typeRef="Results" />
</semantic:inputData>
<semantic:decision id="_46dce6a8-e8cb-492b-86d2-e3c9f7746059" name="Decision Logic 1">
<semantic:variable id="_91a4e0d6-1ac6-41bf-b153-8cafea54d8cb" name="Decision Logic 1" typeRef="Any" />
<semantic:informationRequirement id="_5c2d09d5-8069-4b32-b757-fd01906aad31">
<semantic:requiredInput href="#_a14bfe06-7b6c-4827-bcb8-7365ceb6f0b2" />
</semantic:informationRequirement>
<semantic:literalExpression id="_7c51851e-87b8-4ae7-b556-d46c8a97592d" typeRef="Any" triso:expressionId="_45f12004-f388-4ed4-84c6-f1c584273281">
<semantic:text>max("Results.Height") "group by Results.Competitor"</semantic:text>
</semantic:literalExpression>
</semantic:decision>
<dmndi:DMNDI>
<dmndi:DMNDiagram id="_5a072066-c95d-4f99-a1ae-7422649c5626" name="Page 1">
<dmndi:Size width="1485" height="1050" />
<dmndi:DMNShape id="_bc906a06-f82a-4d50-aae2-9e8aad117a85" dmnElementRef="_a14bfe06-7b6c-4827-bcb8-7365ceb6f0b2">
<dc:Bounds y="186" x="300.2982659339905" width="135.40346813201904" height="60" />
<dmndi:DMNLabel sharedStyle="LS_7e6515d4-dcb0-4652-8fc9-cfc948f1640b_0" />
</dmndi:DMNShape>
<dmndi:DMNShape id="_1cc64c87-2b03-44ad-935e-04d259a4732c" dmnElementRef="_46dce6a8-e8cb-492b-86d2-e3c9f7746059">
<dc:Bounds y="23" x="449.5" width="153" height="60" />
<dmndi:DMNLabel sharedStyle="LS_7e6515d4-dcb0-4652-8fc9-cfc948f1640b_0" xmlns:trisodmn="
http://www.trisotech.com/2016/triso/dmn" trisodmn:defaultBounds="true">
<dc:Bounds y="46.67500019073486" x="452.5" width="146" height="12.649999618530273" />
</dmndi:DMNLabel>
</dmndi:DMNShape>
<dmndi:DMNEdge id="_e14ec571-9cc3-4c56-8de5-1dcf10f3a2e7" dmnElementRef="_5c2d09d5-8069-4b32-b757-fd01906aad31">
<di:waypoint y="186" x="367.9941382408142" />
<di:waypoint y="83" x="516" />
<dmndi:DMNLabel sharedStyle="LS_7e6515d4-dcb0-4652-8fc9-cfc948f1640b_0" />
</dmndi:DMNEdge>
</dmndi:DMNDiagram>
<dmndi:DMNStyle id="LS_7e6515d4-dcb0-4652-8fc9-cfc948f1640b_0" fontFamily="arial,helvetica,sans-serif" fontSize="11" fontBold="false" fontItalic="false" fontUnderline="false" fontStrikeThrough="false" />
</dmndi:DMNDI>
</semantic:definitions>