<?xml version="1.0" encoding="UTF-8"?>
<!-- Incident severity (template incident-management), evaluated by the business rule
     task "Classify severity" of incident_management.bpmn.
     Inputs
       impact    how much of the business is hit: "high", "medium" or "low"
       urgency   how fast it gets worse or must be fixed: "high", "medium" or "low"
     Outputs
       severity        "SEV1" to "SEV4", from the impact and urgency matrix
       majorIncident   true for SEV1 and SEV2: the incident commander is paged and a
                       post-mortem is written
     FIRST: the nine rules cover every pair once; the last one answers anything else
     (a typo, or no triage at all) as a major incident, so an unclear incident is
     escalated rather than left alone. -->
<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/"
  id="def_severity_classification"
  name="Incident severity"
  namespace="http://priostack.com/templates">
  <decision id="severity_classification" name="Severity classification">
    <decisionTable id="dt_severity_classification" hitPolicy="FIRST">
      <input id="in_impact" label="Impact">
        <inputExpression id="ie_impact" typeRef="string">
          <text>impact</text>
        </inputExpression>
      </input>
      <input id="in_urgency" label="Urgency">
        <inputExpression id="ie_urgency" typeRef="string">
          <text>urgency</text>
        </inputExpression>
      </input>
      <output id="out_severity" label="Severity" name="severity" typeRef="string"/>
      <output id="out_major" label="Major incident" name="majorIncident" typeRef="boolean"/>
      <rule id="r_high_high">
        <inputEntry id="ie_hh_impact"><text>"high"</text></inputEntry>
        <inputEntry id="ie_hh_urgency"><text>"high"</text></inputEntry>
        <outputEntry id="oe_hh_severity"><text>"SEV1"</text></outputEntry>
        <outputEntry id="oe_hh_major"><text>true</text></outputEntry>
        <annotationEntry><text>Widespread and getting worse: all hands</text></annotationEntry>
      </rule>
      <rule id="r_high_medium">
        <inputEntry id="ie_hm_impact"><text>"high"</text></inputEntry>
        <inputEntry id="ie_hm_urgency"><text>"medium"</text></inputEntry>
        <outputEntry id="oe_hm_severity"><text>"SEV2"</text></outputEntry>
        <outputEntry id="oe_hm_major"><text>true</text></outputEntry>
      </rule>
      <rule id="r_medium_high">
        <inputEntry id="ie_mh_impact"><text>"medium"</text></inputEntry>
        <inputEntry id="ie_mh_urgency"><text>"high"</text></inputEntry>
        <outputEntry id="oe_mh_severity"><text>"SEV2"</text></outputEntry>
        <outputEntry id="oe_mh_major"><text>true</text></outputEntry>
      </rule>
      <rule id="r_high_low">
        <inputEntry id="ie_hl_impact"><text>"high"</text></inputEntry>
        <inputEntry id="ie_hl_urgency"><text>"low"</text></inputEntry>
        <outputEntry id="oe_hl_severity"><text>"SEV3"</text></outputEntry>
        <outputEntry id="oe_hl_major"><text>false</text></outputEntry>
      </rule>
      <rule id="r_medium_medium">
        <inputEntry id="ie_mm_impact"><text>"medium"</text></inputEntry>
        <inputEntry id="ie_mm_urgency"><text>"medium"</text></inputEntry>
        <outputEntry id="oe_mm_severity"><text>"SEV3"</text></outputEntry>
        <outputEntry id="oe_mm_major"><text>false</text></outputEntry>
      </rule>
      <rule id="r_low_high">
        <inputEntry id="ie_lh_impact"><text>"low"</text></inputEntry>
        <inputEntry id="ie_lh_urgency"><text>"high"</text></inputEntry>
        <outputEntry id="oe_lh_severity"><text>"SEV3"</text></outputEntry>
        <outputEntry id="oe_lh_major"><text>false</text></outputEntry>
      </rule>
      <rule id="r_medium_low">
        <inputEntry id="ie_ml_impact"><text>"medium"</text></inputEntry>
        <inputEntry id="ie_ml_urgency"><text>"low"</text></inputEntry>
        <outputEntry id="oe_ml_severity"><text>"SEV4"</text></outputEntry>
        <outputEntry id="oe_ml_major"><text>false</text></outputEntry>
      </rule>
      <rule id="r_low_medium">
        <inputEntry id="ie_lm_impact"><text>"low"</text></inputEntry>
        <inputEntry id="ie_lm_urgency"><text>"medium"</text></inputEntry>
        <outputEntry id="oe_lm_severity"><text>"SEV4"</text></outputEntry>
        <outputEntry id="oe_lm_major"><text>false</text></outputEntry>
      </rule>
      <rule id="r_low_low">
        <inputEntry id="ie_ll_impact"><text>"low"</text></inputEntry>
        <inputEntry id="ie_ll_urgency"><text>"low"</text></inputEntry>
        <outputEntry id="oe_ll_severity"><text>"SEV4"</text></outputEntry>
        <outputEntry id="oe_ll_major"><text>false</text></outputEntry>
      </rule>
      <rule id="r_unclear">
        <inputEntry id="ie_unclear_impact"><text>-</text></inputEntry>
        <inputEntry id="ie_unclear_urgency"><text>-</text></inputEntry>
        <outputEntry id="oe_unclear_severity"><text>"SEV2"</text></outputEntry>
        <outputEntry id="oe_unclear_major"><text>true</text></outputEntry>
        <annotationEntry><text>Not triaged as high, medium or low: treated as major until someone triages it</text></annotationEntry>
      </rule>
    </decisionTable>
  </decision>
  <dmndi:DMNDI>
    <dmndi:DMNDiagram>
      <dmndi:DMNShape dmnElementRef="severity_classification">
        <dc:Bounds x="157" y="81" width="180" height="80"/>
      </dmndi:DMNShape>
    </dmndi:DMNDiagram>
  </dmndi:DMNDI>
</definitions>
