<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:modeler="http://camunda.org/schema/modeler/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="@bpmnkit/core" exporterVersion="0.0.23" modeler:executionPlatform="Camunda Cloud" modeler:executionPlatformVersion="8.9.0">
  <bpmn:process id="incident-escalation" name="Incident Escalation" isExecutable="true">
    <bpmn:extensionElements>
      <zeebe:versionTag value="1.0.0"/>
    </bpmn:extensionElements>
    <bpmn:startEvent id="alert-fired" name="Alert fired">
      <bpmn:outgoing>Flow_alert-fired_classify-severity</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:businessRuleTask id="classify-severity" name="Classify severity">
      <bpmn:extensionElements>
        <zeebe:calledDecision decisionId="incident-severity" resultVariable="severity"/>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_alert-fired_classify-severity</bpmn:incoming>
      <bpmn:outgoing>Flow_classify-severity_minor</bpmn:outgoing>
    </bpmn:businessRuleTask>
    <bpmn:exclusiveGateway id="minor" name="Sev 3?" default="Flow_minor_page-on-call">
      <bpmn:incoming>Flow_classify-severity_minor</bpmn:incoming>
      <bpmn:outgoing>Flow_minor_create-ticket</bpmn:outgoing>
      <bpmn:outgoing>Flow_minor_page-on-call</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="create-ticket" name="Create backlog ticket">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="ticket-create"/>
        <zeebe:ioMapping>
          <zeebe:output source="=ticketId" target="ticketId"/>
        </zeebe:ioMapping>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_minor_create-ticket</bpmn:incoming>
      <bpmn:outgoing>Flow_create-ticket_ticket-created</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="ticket-created" name="Ticket created">
      <bpmn:incoming>Flow_create-ticket_ticket-created</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:serviceTask id="page-on-call" name="Page on-call engineer">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pager-page"/>
        <zeebe:taskHeaders>
          <zeebe:header key="escalationPolicy" value="primary"/>
        </zeebe:taskHeaders>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_minor_page-on-call</bpmn:incoming>
      <bpmn:outgoing>Flow_page-on-call_acknowledge</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:userTask id="acknowledge" name="Acknowledge incident">
      <bpmn:extensionElements>
        <zeebe:userTask/>
        <zeebe:assignmentDefinition candidateGroups="on-call"/>
        <zeebe:priorityDefinition priority="90"/>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_page-on-call_acknowledge</bpmn:incoming>
      <bpmn:outgoing>Flow_acknowledge_ack-merge</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:boundaryEvent id="ack-overdue" name="15 min unacknowledged" attachedToRef="acknowledge">
      <bpmn:outgoing>Flow_ack-overdue_page-commander</bpmn:outgoing>
      <bpmn:timerEventDefinition>
        <bpmn:timeDuration>PT15M</bpmn:timeDuration>
      </bpmn:timerEventDefinition>
    </bpmn:boundaryEvent>
    <bpmn:serviceTask id="page-commander" name="Page incident commander">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="pager-page"/>
        <zeebe:taskHeaders>
          <zeebe:header key="escalationPolicy" value="incident-commander"/>
        </zeebe:taskHeaders>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_ack-overdue_page-commander</bpmn:incoming>
      <bpmn:outgoing>Flow_page-commander_ack-merge</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="ack-merge">
      <bpmn:incoming>Flow_acknowledge_ack-merge</bpmn:incoming>
      <bpmn:incoming>Flow_page-commander_ack-merge</bpmn:incoming>
      <bpmn:outgoing>Flow_ack-merge_mitigate</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:userTask id="mitigate" name="Mitigate and resolve">
      <bpmn:extensionElements>
        <zeebe:userTask/>
        <zeebe:assignmentDefinition candidateGroups="on-call"/>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_ack-merge_mitigate</bpmn:incoming>
      <bpmn:outgoing>Flow_mitigate_update-status-page</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:serviceTask id="update-status-page" name="Publish status update">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="statuspage-update"/>
        <zeebe:taskHeaders>
          <zeebe:header key="status" value="resolved"/>
        </zeebe:taskHeaders>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_mitigate_update-status-page</bpmn:incoming>
      <bpmn:outgoing>Flow_update-status-page_needs-postmortem</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="needs-postmortem" name="Sev 1?" default="Flow_needs-postmortem_resolved">
      <bpmn:incoming>Flow_update-status-page_needs-postmortem</bpmn:incoming>
      <bpmn:outgoing>Flow_needs-postmortem_write-postmortem</bpmn:outgoing>
      <bpmn:outgoing>Flow_needs-postmortem_resolved</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:userTask id="write-postmortem" name="Write post-mortem">
      <bpmn:extensionElements>
        <zeebe:userTask/>
        <zeebe:assignmentDefinition candidateGroups="sre"/>
        <zeebe:taskSchedule dueDate="=now() + duration(&quot;P5D&quot;)"/>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_needs-postmortem_write-postmortem</bpmn:incoming>
      <bpmn:outgoing>Flow_write-postmortem_postmortem-done</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:endEvent id="postmortem-done" name="Post-mortem published">
      <bpmn:incoming>Flow_write-postmortem_postmortem-done</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:endEvent id="resolved" name="Incident resolved">
      <bpmn:incoming>Flow_needs-postmortem_resolved</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="Flow_alert-fired_classify-severity" sourceRef="alert-fired" targetRef="classify-severity"/>
    <bpmn:sequenceFlow id="Flow_classify-severity_minor" sourceRef="classify-severity" targetRef="minor"/>
    <bpmn:sequenceFlow id="Flow_minor_create-ticket" sourceRef="minor" targetRef="create-ticket" name="ticket">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=severity = "sev3"</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_create-ticket_ticket-created" sourceRef="create-ticket" targetRef="ticket-created"/>
    <bpmn:sequenceFlow id="Flow_minor_page-on-call" sourceRef="minor" targetRef="page-on-call" name="page"/>
    <bpmn:sequenceFlow id="Flow_page-on-call_acknowledge" sourceRef="page-on-call" targetRef="acknowledge"/>
    <bpmn:sequenceFlow id="Flow_acknowledge_ack-merge" sourceRef="acknowledge" targetRef="ack-merge"/>
    <bpmn:sequenceFlow id="Flow_ack-overdue_page-commander" sourceRef="ack-overdue" targetRef="page-commander"/>
    <bpmn:sequenceFlow id="Flow_page-commander_ack-merge" sourceRef="page-commander" targetRef="ack-merge"/>
    <bpmn:sequenceFlow id="Flow_ack-merge_mitigate" sourceRef="ack-merge" targetRef="mitigate"/>
    <bpmn:sequenceFlow id="Flow_mitigate_update-status-page" sourceRef="mitigate" targetRef="update-status-page"/>
    <bpmn:sequenceFlow id="Flow_update-status-page_needs-postmortem" sourceRef="update-status-page" targetRef="needs-postmortem"/>
    <bpmn:sequenceFlow id="Flow_needs-postmortem_write-postmortem" sourceRef="needs-postmortem" targetRef="write-postmortem" name="postmortem">
      <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=severity = "sev1"</bpmn:conditionExpression>
    </bpmn:sequenceFlow>
    <bpmn:sequenceFlow id="Flow_write-postmortem_postmortem-done" sourceRef="write-postmortem" targetRef="postmortem-done"/>
    <bpmn:sequenceFlow id="Flow_needs-postmortem_resolved" sourceRef="needs-postmortem" targetRef="resolved" name="done"/>
  </bpmn:process>
  <bpmndi:BPMNDiagram id="incident-escalation_di">
    <bpmndi:BPMNPlane id="incident-escalation_di_plane" bpmnElement="incident-escalation">
      <bpmndi:BPMNShape id="alert-fired_di" bpmnElement="alert-fired">
        <dc:Bounds x="41" y="42" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="20" y="82" width="77" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="classify-severity_di" bpmnElement="classify-severity">
        <dc:Bounds x="177" y="20" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="minor_di" bpmnElement="minor">
        <dc:Bounds x="377" y="35" width="50" height="50"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="381" y="89" width="42" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="create-ticket_di" bpmnElement="create-ticket">
        <dc:Bounds x="527" y="180" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="ticket-created_di" bpmnElement="ticket-created">
        <dc:Bounds x="759" y="202" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="728" y="242" width="98" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="page-on-call_di" bpmnElement="page-on-call">
        <dc:Bounds x="527" y="20" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="acknowledge_di" bpmnElement="acknowledge">
        <dc:Bounds x="727" y="20" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="ack-overdue_di" bpmnElement="ack-overdue">
        <dc:Bounds x="759" y="82" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="703" y="122" width="147" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="page-commander_di" bpmnElement="page-commander">
        <dc:Bounds x="927" y="180" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="ack-merge_di" bpmnElement="ack-merge">
        <dc:Bounds x="1127" y="35" width="50" height="50"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="mitigate_di" bpmnElement="mitigate">
        <dc:Bounds x="1277" y="20" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="update-status-page_di" bpmnElement="update-status-page">
        <dc:Bounds x="1477" y="20" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="needs-postmortem_di" bpmnElement="needs-postmortem">
        <dc:Bounds x="1677" y="35" width="50" height="50"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1681" y="89" width="42" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="write-postmortem_di" bpmnElement="write-postmortem">
        <dc:Bounds x="1827" y="180" width="100" height="80"/>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="postmortem-done_di" bpmnElement="postmortem-done">
        <dc:Bounds x="2027" y="202" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1971" y="242" width="147" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="resolved_di" bpmnElement="resolved">
        <dc:Bounds x="1859" y="42" width="36" height="36"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1817" y="82" width="119" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_alert-fired_classify-severity_di" bpmnElement="Flow_alert-fired_classify-severity">
        <di:waypoint x="77" y="60"/>
        <di:waypoint x="177" y="60"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_classify-severity_minor_di" bpmnElement="Flow_classify-severity_minor">
        <di:waypoint x="277" y="60"/>
        <di:waypoint x="377" y="60"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_minor_create-ticket_di" bpmnElement="Flow_minor_create-ticket">
        <di:waypoint x="402" y="85"/>
        <di:waypoint x="402" y="220"/>
        <di:waypoint x="527" y="220"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="378" y="146" width="42" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_create-ticket_ticket-created_di" bpmnElement="Flow_create-ticket_ticket-created">
        <di:waypoint x="627" y="220"/>
        <di:waypoint x="759" y="220"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_minor_page-on-call_di" bpmnElement="Flow_minor_page-on-call">
        <di:waypoint x="427" y="60"/>
        <di:waypoint x="527" y="60"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="457" y="36" width="40" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_page-on-call_acknowledge_di" bpmnElement="Flow_page-on-call_acknowledge">
        <di:waypoint x="627" y="60"/>
        <di:waypoint x="727" y="60"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_acknowledge_ack-merge_di" bpmnElement="Flow_acknowledge_ack-merge">
        <di:waypoint x="827" y="60"/>
        <di:waypoint x="1127" y="60"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_ack-overdue_page-commander_di" bpmnElement="Flow_ack-overdue_page-commander">
        <di:waypoint x="777" y="118"/>
        <di:waypoint x="777" y="138"/>
        <di:waypoint x="877" y="138"/>
        <di:waypoint x="877" y="220"/>
        <di:waypoint x="927" y="220"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_page-commander_ack-merge_di" bpmnElement="Flow_page-commander_ack-merge">
        <di:waypoint x="977" y="180"/>
        <di:waypoint x="977" y="133"/>
        <di:waypoint x="1152" y="133"/>
        <di:waypoint x="1152" y="85"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_ack-merge_mitigate_di" bpmnElement="Flow_ack-merge_mitigate">
        <di:waypoint x="1177" y="60"/>
        <di:waypoint x="1277" y="60"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_mitigate_update-status-page_di" bpmnElement="Flow_mitigate_update-status-page">
        <di:waypoint x="1377" y="60"/>
        <di:waypoint x="1477" y="60"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_update-status-page_needs-postmortem_di" bpmnElement="Flow_update-status-page_needs-postmortem">
        <di:waypoint x="1577" y="60"/>
        <di:waypoint x="1677" y="60"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_needs-postmortem_write-postmortem_di" bpmnElement="Flow_needs-postmortem_write-postmortem">
        <di:waypoint x="1702" y="85"/>
        <di:waypoint x="1702" y="220"/>
        <di:waypoint x="1827" y="220"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1678" y="146" width="70" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_write-postmortem_postmortem-done_di" bpmnElement="Flow_write-postmortem_postmortem-done">
        <di:waypoint x="1927" y="220"/>
        <di:waypoint x="2027" y="220"/>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_needs-postmortem_resolved_di" bpmnElement="Flow_needs-postmortem_resolved">
        <di:waypoint x="1727" y="60"/>
        <di:waypoint x="1859" y="60"/>
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1773" y="36" width="40" height="14"/>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

