<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="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"
             targetNamespace="http://openrpms.org/bpmn"
             id="credential-tracking-with-expiration-alerts">

  <collaboration id="Collab_Credentials">
    <participant id="Part_AdminClerk" name="Administration Clerk" processRef="Process_AdminClerk" />
    <participant id="Part_CredSystem" name="RPMS Credentials System" processRef="Process_CredSystem" />
  </collaboration>

  <process id="Process_AdminClerk" isExecutable="false">
    <startEvent id="Start_RunReport" name="Run credential status report">
      <outgoing>F1</outgoing>
    </startEvent>
    <task id="Task_ReviewAlerts" name="Review expiring licenses and privilege renewals">
      <incoming>F1</incoming>
      <outgoing>F2</outgoing>
    </task>
    <task id="Task_NotifyProviders" name="System sends automated alerts to affected providers">
      <incoming>F2</incoming>
      <outgoing>F3</outgoing>
    </task>
    <endEvent id="End_AlertsSent" name="Providers notified">
      <incoming>F3</incoming>
    </endEvent>
    <sequenceFlow id="F1" sourceRef="Start_RunReport" targetRef="Task_ReviewAlerts" />
    <sequenceFlow id="F2" sourceRef="Task_ReviewAlerts" targetRef="Task_NotifyProviders" />
    <sequenceFlow id="F3" sourceRef="Task_NotifyProviders" targetRef="End_AlertsSent" />
  </process>

  <process id="Process_CredSystem" isExecutable="false">
    <startEvent id="Start_CredCheck" name="Credential expiration check triggered">
      <outgoing>F4</outgoing>
    </startEvent>
    <task id="Task_EvaluateExpiry" name="Evaluate all credential and privilege expiration dates">
      <incoming>F4</incoming>
      <outgoing>F5</outgoing>
    </task>
    <endEvent id="End_ReportGenerated" name="Status report generated">
      <incoming>F5</incoming>
    </endEvent>
    <sequenceFlow id="F4" sourceRef="Start_CredCheck" targetRef="Task_EvaluateExpiry" />
    <sequenceFlow id="F5" sourceRef="Task_EvaluateExpiry" targetRef="End_ReportGenerated" />
  </process>

  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Collab_Credentials">
      <bpmndi:BPMNShape id="S_AdminClerk" bpmnElement="Part_AdminClerk" isHorizontal="true"><dc:Bounds x="160" y="80" width="760" height="160" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="S_CredSystem" bpmnElement="Part_CredSystem" isHorizontal="true"><dc:Bounds x="160" y="240" width="760" height="160" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="S_Start_RunReport" bpmnElement="Start_RunReport"><dc:Bounds x="212" y="142" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="190" y="185" width="80" height="27" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="S_Task_ReviewAlerts" bpmnElement="Task_ReviewAlerts"><dc:Bounds x="300" y="120" width="200" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="S_Task_NotifyProviders" bpmnElement="Task_NotifyProviders"><dc:Bounds x="580" y="120" width="200" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="S_End_AlertsSent" bpmnElement="End_AlertsSent"><dc:Bounds x="832" y="142" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="810" y="185" width="80" height="27" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="S_Start_CredCheck" bpmnElement="Start_CredCheck"><dc:Bounds x="212" y="302" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="190" y="345" width="80" height="27" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="S_Task_EvaluateExpiry" bpmnElement="Task_EvaluateExpiry"><dc:Bounds x="460" y="280" width="200" height="80" /></bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="S_End_ReportGenerated" bpmnElement="End_ReportGenerated"><dc:Bounds x="712" y="302" width="36" height="36" /><bpmndi:BPMNLabel><dc:Bounds x="690" y="345" width="80" height="27" /></bpmndi:BPMNLabel></bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="E_F1" bpmnElement="F1"><di:waypoint x="248" y="160" /><di:waypoint x="300" y="160" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="E_F2" bpmnElement="F2"><di:waypoint x="500" y="160" /><di:waypoint x="580" y="160" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="E_F3" bpmnElement="F3"><di:waypoint x="780" y="160" /><di:waypoint x="832" y="160" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="E_F4" bpmnElement="F4"><di:waypoint x="248" y="320" /><di:waypoint x="460" y="320" /></bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="E_F5" bpmnElement="F5"><di:waypoint x="660" y="320" /><di:waypoint x="712" y="320" /></bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>
