<?xml version="1.0" encoding="UTF-8"?>
<!-- Example 2: the risk and the type of a change (ITIL). Impact from components and the label production, urgency from the priority, the risk as a matrix, the type of change on top. Synthetic example of Flower BPM. -->
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" id="change-risk_defs" name="Change risk" namespace="https://flower-bpm.com/dmn/examples">
  <decision id="impact" name="Impact">

    <decisionTable id="impact_table" hitPolicy="FIRST">
      <input id="in_1" label="Components affected"><inputExpression id="ie_2" typeRef="number"><text>count(pi.fields.components)</text></inputExpression></input>
      <input id="in_3" label="In production"><inputExpression id="ie_4" typeRef="boolean"><text>list contains(pi.fields.labels, &quot;production&quot;)</text></inputExpression></input>
      <output id="out_5" label="Impact" name="impact" typeRef="string"></output>
      <rule id="r_6"><description>Production and several components</description><inputEntry id="e_7"><text>&gt;= 3</text></inputEntry><inputEntry id="e_8"><text>true</text></inputEntry><outputEntry id="o_9"><text>&quot;high&quot;</text></outputEntry></rule>
      <rule id="r_10"><description>Production</description><inputEntry id="e_11"><text>-</text></inputEntry><inputEntry id="e_12"><text>true</text></inputEntry><outputEntry id="o_13"><text>&quot;medium&quot;</text></outputEntry></rule>
      <rule id="r_14"><description>Not in production</description><inputEntry id="e_15"><text>-</text></inputEntry><inputEntry id="e_16"><text>-</text></inputEntry><outputEntry id="o_17"><text>&quot;low&quot;</text></outputEntry></rule>
    </decisionTable>
  </decision>
  <decision id="urgency" name="Urgency">

    <decisionTable id="urgency_table" hitPolicy="UNIQUE">
      <input id="in_18" label="Priority"><inputExpression id="ie_19" typeRef="string"><text>pi.fields.priority.name</text></inputExpression></input>
      <output id="out_20" label="Urgency" name="urgency" typeRef="string"></output>
      <rule id="r_21"><description></description><inputEntry id="e_22"><text>&quot;Highest&quot;</text></inputEntry><outputEntry id="o_23"><text>&quot;critical&quot;</text></outputEntry></rule>
      <rule id="r_24"><description></description><inputEntry id="e_25"><text>&quot;High&quot;</text></inputEntry><outputEntry id="o_26"><text>&quot;high&quot;</text></outputEntry></rule>
      <rule id="r_27"><description></description><inputEntry id="e_28"><text>&quot;Medium&quot;</text></inputEntry><outputEntry id="o_29"><text>&quot;medium&quot;</text></outputEntry></rule>
      <rule id="r_30"><description></description><inputEntry id="e_31"><text>&quot;Low&quot;, &quot;Lowest&quot;</text></inputEntry><outputEntry id="o_32"><text>&quot;low&quot;</text></outputEntry></rule>
      <rule id="r_33"><description>No priority</description><inputEntry id="e_34"><text>not(&quot;Highest&quot;, &quot;High&quot;, &quot;Medium&quot;, &quot;Low&quot;, &quot;Lowest&quot;)</text></inputEntry><outputEntry id="o_35"><text>&quot;medium&quot;</text></outputEntry></rule>
    </decisionTable>
  </decision>
  <decision id="riskClass" name="Risk class">
    <informationRequirement id="ir_36"><requiredDecision href="#impact" /></informationRequirement>
    <informationRequirement id="ir_37"><requiredDecision href="#urgency" /></informationRequirement>
    <decisionTable id="riskClass_table" hitPolicy="UNIQUE">
      <input id="in_38" label="Impact"><inputExpression id="ie_39" typeRef="string"><text>Impact</text></inputExpression></input>
      <input id="in_40" label="Urgency"><inputExpression id="ie_41" typeRef="string"><text>Urgency</text></inputExpression></input>
      <output id="out_42" label="Risk class" name="riskClass" typeRef="string"></output>
      <rule id="r_43"><description></description><inputEntry id="e_44"><text>&quot;high&quot;</text></inputEntry><inputEntry id="e_45"><text>-</text></inputEntry><outputEntry id="o_46"><text>&quot;high&quot;</text></outputEntry></rule>
      <rule id="r_47"><description></description><inputEntry id="e_48"><text>&quot;medium&quot;</text></inputEntry><inputEntry id="e_49"><text>&quot;critical&quot;, &quot;high&quot;</text></inputEntry><outputEntry id="o_50"><text>&quot;high&quot;</text></outputEntry></rule>
      <rule id="r_51"><description></description><inputEntry id="e_52"><text>&quot;medium&quot;</text></inputEntry><inputEntry id="e_53"><text>&quot;medium&quot;, &quot;low&quot;</text></inputEntry><outputEntry id="o_54"><text>&quot;medium&quot;</text></outputEntry></rule>
      <rule id="r_55"><description></description><inputEntry id="e_56"><text>&quot;low&quot;</text></inputEntry><inputEntry id="e_57"><text>&quot;critical&quot;, &quot;high&quot;</text></inputEntry><outputEntry id="o_58"><text>&quot;medium&quot;</text></outputEntry></rule>
      <rule id="r_59"><description></description><inputEntry id="e_60"><text>&quot;low&quot;</text></inputEntry><inputEntry id="e_61"><text>&quot;medium&quot;, &quot;low&quot;</text></inputEntry><outputEntry id="o_62"><text>&quot;low&quot;</text></outputEntry></rule>
    </decisionTable>
  </decision>
  <decision id="changeType" name="Type of change">
    <informationRequirement id="ir_63"><requiredDecision href="#riskClass" /></informationRequirement>
    <informationRequirement id="ir_64"><requiredDecision href="#urgency" /></informationRequirement>
    <decisionTable id="changeType_table" hitPolicy="FIRST">
      <input id="in_65" label="Risk class"><inputExpression id="ie_66" typeRef="string"><text>Risk class</text></inputExpression></input>
      <input id="in_67" label="Urgency"><inputExpression id="ie_68" typeRef="string"><text>Urgency</text></inputExpression></input>
      <input id="in_69" label="Pre-approved"><inputExpression id="ie_70" typeRef="boolean"><text>list contains(pi.fields.labels, &quot;standard-change&quot;)</text></inputExpression></input>
      <output id="out_71" label="Type of change" name="changeType" typeRef="string"></output>
      <output id="out_72" label="Change advisory board" name="cab" typeRef="boolean"></output>
      <rule id="r_73"><description>Critical: emergency approval</description><inputEntry id="e_74"><text>-</text></inputEntry><inputEntry id="e_75"><text>&quot;critical&quot;</text></inputEntry><inputEntry id="e_76"><text>-</text></inputEntry><outputEntry id="o_77"><text>&quot;Emergency&quot;</text></outputEntry><outputEntry id="o_78"><text>false</text></outputEntry></rule>
      <rule id="r_79"><description>Pre-approved and low risk</description><inputEntry id="e_80"><text>&quot;low&quot;</text></inputEntry><inputEntry id="e_81"><text>-</text></inputEntry><inputEntry id="e_82"><text>true</text></inputEntry><outputEntry id="o_83"><text>&quot;Standard&quot;</text></outputEntry><outputEntry id="o_84"><text>false</text></outputEntry></rule>
      <rule id="r_85"><description>Low risk</description><inputEntry id="e_86"><text>&quot;low&quot;</text></inputEntry><inputEntry id="e_87"><text>-</text></inputEntry><inputEntry id="e_88"><text>-</text></inputEntry><outputEntry id="o_89"><text>&quot;Normal&quot;</text></outputEntry><outputEntry id="o_90"><text>false</text></outputEntry></rule>
      <rule id="r_91"><description>Medium or high risk: the CAB decides</description><inputEntry id="e_92"><text>-</text></inputEntry><inputEntry id="e_93"><text>-</text></inputEntry><inputEntry id="e_94"><text>-</text></inputEntry><outputEntry id="o_95"><text>&quot;Normal&quot;</text></outputEntry><outputEntry id="o_96"><text>true</text></outputEntry></rule>
    </decisionTable>
  </decision>
  <dmndi:DMNDI><dmndi:DMNDiagram id="change-risk_drd">
      <dmndi:DMNShape id="impact_di" dmnElementRef="impact"><dc:Bounds height="80" width="180" x="60" y="440" /></dmndi:DMNShape>
      <dmndi:DMNShape id="urgency_di" dmnElementRef="urgency"><dc:Bounds height="80" width="180" x="360" y="440" /></dmndi:DMNShape>
      <dmndi:DMNShape id="riskClass_di" dmnElementRef="riskClass"><dc:Bounds height="80" width="180" x="180" y="260" /></dmndi:DMNShape>
      <dmndi:DMNShape id="changeType_di" dmnElementRef="changeType"><dc:Bounds height="80" width="180" x="180" y="80" /></dmndi:DMNShape>
      <dmndi:DMNEdge id="edge_97" dmnElementRef="ir_36"><di:waypoint x="150" y="440" /><di:waypoint x="270" y="340" /></dmndi:DMNEdge>
      <dmndi:DMNEdge id="edge_98" dmnElementRef="ir_37"><di:waypoint x="450" y="440" /><di:waypoint x="270" y="340" /></dmndi:DMNEdge>
      <dmndi:DMNEdge id="edge_99" dmnElementRef="ir_63"><di:waypoint x="270" y="260" /><di:waypoint x="270" y="160" /></dmndi:DMNEdge>
      <dmndi:DMNEdge id="edge_100" dmnElementRef="ir_64"><di:waypoint x="450" y="440" /><di:waypoint x="270" y="160" /></dmndi:DMNEdge>
  </dmndi:DMNDiagram></dmndi:DMNDI>
</definitions>
