<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
    xmlns:activiti="http://activiti.org/bpmn"
    xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
    xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema"
    expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef"
    xmlns:modeler="http://activiti.com/modeler" modeler:version="1.0ev" modeler:exportDateTime="20180628141905" modeler:modelId="1046216"
    modeler:modelVersion="1" modeler:modelLastUpdated="1530191931844">
    <process id="privacy-extension-delete-process" name="privacy-extension-delete-process" isExecutable="true">
        <documentation>This business process runs when the Subject Access Request enters the Delete queue.</documentation>
        <startEvent id="startEvent1">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[startEvent1]]></modeler:editor-resource-id>
            </extensionElements>
        </startEvent>
        <serviceTask id="sid-E0905ADB-9340-49AC-ADA5-3AD0B417D585" name="Set Subject Access Request status"
                     activiti:expression="#{changeObjectStatusService.changeIfNoPermanentStatusIsSet(OBJECT_ID, OBJECT_TYPE, 'Deleted', 'Closed')}">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-E0905ADB-9340-49AC-ADA5-3AD0B417D585]]></modeler:editor-resource-id>
            </extensionElements>
        </serviceTask>
        <sequenceFlow id="sid-A1A80BC3-B3F3-472A-8187-6EF2428E1D51" sourceRef="sid-E0905ADB-9340-49AC-ADA5-3AD0B417D585"
            targetRef="sid-F88A33F4-A31E-43B6-A65C-0921762C023D">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-A1A80BC3-B3F3-472A-8187-6EF2428E1D51]]></modeler:editor-resource-id>
            </extensionElements>
        </sequenceFlow>
        <serviceTask id="sid-F88A33F4-A31E-43B6-A65C-0921762C023D" name="Place Subject Access Request in Delete queue"
            activiti:expression="#{queueCaseService.enqueue(OBJECT_ID, 'Delete')}">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-F88A33F4-A31E-43B6-A65C-0921762C023D]]></modeler:editor-resource-id>
            </extensionElements>
        </serviceTask>
        <endEvent id="sid-2158CAAD-78C1-465F-B109-70C2FCF1FF39">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-2158CAAD-78C1-465F-B109-70C2FCF1FF39]]></modeler:editor-resource-id>
            </extensionElements>
        </endEvent>
        <serviceTask id="sid-2167F52E-04D5-4C2E-9A38-D98ED86B49D8" name="Generate Delete Correspondence letter"
            activiti:expression="#{sarQueueCorrespondenceService.handleDeleteCorrespondenceLetter(OBJECT_ID)}">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-2167F52E-04D5-4C2E-9A38-D98ED86B49D8]]></modeler:editor-resource-id>
            </extensionElements>
        </serviceTask>
        <sequenceFlow id="sid-9CC4EEEB-90ED-4DEC-9FBC-0F27FC1CE629" sourceRef="sid-F88A33F4-A31E-43B6-A65C-0921762C023D"
            targetRef="sid-2167F52E-04D5-4C2E-9A38-D98ED86B49D8">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-9CC4EEEB-90ED-4DEC-9FBC-0F27FC1CE629]]></modeler:editor-resource-id>
            </extensionElements>
        </sequenceFlow>
        <serviceTask id="sid-E330A28D-4B02-414C-BEE1-45D45AA62CF6" name="Compress the Response folder"
            activiti:expression="#{responseFolderCompressorService.compressResponseFolder(OBJECT_ID)}">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-E330A28D-4B02-414C-BEE1-45D45AA62CF6]]></modeler:editor-resource-id>
            </extensionElements>
        </serviceTask>
        <serviceTask id="sid-81AE19A9-D0AC-4905-8BDF-3958212581EA" name="Send the compressed Response folder file to outbound message queue"
            activiti:expression="#{sarFileBrokerClient.sendReleaseFile(OBJECT_ID)}">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-81AE19A9-D0AC-4905-8BDF-3958212581EA]]></modeler:editor-resource-id>
            </extensionElements>
        </serviceTask>
        <sequenceFlow id="sid-E6BD585E-E84E-404A-B4B6-37D294685B0F" sourceRef="sid-2167F52E-04D5-4C2E-9A38-D98ED86B49D8"
            targetRef="sid-E330A28D-4B02-414C-BEE1-45D45AA62CF6">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-E6BD585E-E84E-404A-B4B6-37D294685B0F]]></modeler:editor-resource-id>
            </extensionElements>
        </sequenceFlow>
        <sequenceFlow id="sid-2ECFBB0E-7B21-4B25-9FA3-6D8134E86DA4" sourceRef="startEvent1"
            targetRef="sid-E0905ADB-9340-49AC-ADA5-3AD0B417D585">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-2ECFBB0E-7B21-4B25-9FA3-6D8134E86DA4]]></modeler:editor-resource-id>
            </extensionElements>
        </sequenceFlow>
        <sequenceFlow id="sid-9870CDCC-F950-4DE5-BAD0-171312094649" sourceRef="sid-81AE19A9-D0AC-4905-8BDF-3958212581EA"
            targetRef="sid-2158CAAD-78C1-465F-B109-70C2FCF1FF39">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-9870CDCC-F950-4DE5-BAD0-171312094649]]></modeler:editor-resource-id>
            </extensionElements>
        </sequenceFlow>
        <sequenceFlow id="sid-A062CA14-F323-41B8-A675-1A627DBE92F6" sourceRef="sid-E330A28D-4B02-414C-BEE1-45D45AA62CF6"
            targetRef="sid-81AE19A9-D0AC-4905-8BDF-3958212581EA">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-A062CA14-F323-41B8-A675-1A627DBE92F6]]></modeler:editor-resource-id>
            </extensionElements>
        </sequenceFlow>
        <textAnnotation id="sid-A4DD8BA4-1458-4B2D-A55F-9098105D10A5">
            <extensionElements>
                <modeler:editor-resource-id><![CDATA[sid-A4DD8BA4-1458-4B2D-A55F-9098105D10A5]]></modeler:editor-resource-id>
            </extensionElements>
            <text>This process orchestrates all the actions needed when a Subject Access Request is entering the Delete queue.
                Currently there are five such actions:

                1. Set the status to Deleted, if status is not Closed
                2. Set the queue name to 'Delete'
                3. Generate Delete Correspondence letter
                4.Compress the Response folder
                5.Send the compressed Response folder file to outbound message queue
            </text>
        </textAnnotation>
    </process>
    <bpmndi:BPMNDiagram id="BPMNDiagram_privacy-extension-delete-process">
        <bpmndi:BPMNPlane bpmnElement="privacy-extension-delete-process" id="BPMNPlane_privacy-extension-delete-process">
            <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
                <omgdc:Bounds height="30.0" width="30.0" x="100.0" y="163.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-E0905ADB-9340-49AC-ADA5-3AD0B417D585"
                id="BPMNShape_sid-E0905ADB-9340-49AC-ADA5-3AD0B417D585">
                <omgdc:Bounds height="80.0" width="100.0" x="219.75" y="138.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-F88A33F4-A31E-43B6-A65C-0921762C023D"
                id="BPMNShape_sid-F88A33F4-A31E-43B6-A65C-0921762C023D">
                <omgdc:Bounds height="80.0" width="100.0" x="384.75" y="138.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-2158CAAD-78C1-465F-B109-70C2FCF1FF39"
                id="BPMNShape_sid-2158CAAD-78C1-465F-B109-70C2FCF1FF39">
                <omgdc:Bounds height="28.0" width="28.0" x="1020.0" y="164.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-A4DD8BA4-1458-4B2D-A55F-9098105D10A5"
                id="BPMNShape_sid-A4DD8BA4-1458-4B2D-A55F-9098105D10A5">
                <omgdc:Bounds height="227.0" width="294.0" x="195.0" y="255.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-2167F52E-04D5-4C2E-9A38-D98ED86B49D8"
                id="BPMNShape_sid-2167F52E-04D5-4C2E-9A38-D98ED86B49D8">
                <omgdc:Bounds height="69.0" width="117.0" x="525.0" y="144.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-E330A28D-4B02-414C-BEE1-45D45AA62CF6"
                id="BPMNShape_sid-E330A28D-4B02-414C-BEE1-45D45AA62CF6">
                <omgdc:Bounds height="80.0" width="100.0" x="705.0" y="138.5"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-81AE19A9-D0AC-4905-8BDF-3958212581EA"
                id="BPMNShape_sid-81AE19A9-D0AC-4905-8BDF-3958212581EA">
                <omgdc:Bounds height="92.0" width="112.0" x="858.5" y="132.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNEdge bpmnElement="sid-9870CDCC-F950-4DE5-BAD0-171312094649" id="BPMNEdge_sid-9870CDCC-F950-4DE5-BAD0-171312094649">
                <omgdi:waypoint x="970.5" y="178.0"/>
                <omgdi:waypoint x="1020.0" y="178.0"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-A062CA14-F323-41B8-A675-1A627DBE92F6" id="BPMNEdge_sid-A062CA14-F323-41B8-A675-1A627DBE92F6">
                <omgdi:waypoint x="805.0" y="178.34326018808778"/>
                <omgdi:waypoint x="858.5" y="178.1755485893417"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-9CC4EEEB-90ED-4DEC-9FBC-0F27FC1CE629" id="BPMNEdge_sid-9CC4EEEB-90ED-4DEC-9FBC-0F27FC1CE629">
                <omgdi:waypoint x="484.75" y="178.16806722689074"/>
                <omgdi:waypoint x="525.0" y="178.30336134453782"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-E6BD585E-E84E-404A-B4B6-37D294685B0F" id="BPMNEdge_sid-E6BD585E-E84E-404A-B4B6-37D294685B0F">
                <omgdi:waypoint x="642.0" y="178.5"/>
                <omgdi:waypoint x="705.0" y="178.5"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-2ECFBB0E-7B21-4B25-9FA3-6D8134E86DA4" id="BPMNEdge_sid-2ECFBB0E-7B21-4B25-9FA3-6D8134E86DA4">
                <omgdi:waypoint x="130.0" y="178.0"/>
                <omgdi:waypoint x="219.75" y="178.0"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-A1A80BC3-B3F3-472A-8187-6EF2428E1D51" id="BPMNEdge_sid-A1A80BC3-B3F3-472A-8187-6EF2428E1D51">
                <omgdi:waypoint x="319.75" y="178.0"/>
                <omgdi:waypoint x="384.75" y="178.0"/>
            </bpmndi:BPMNEdge>
        </bpmndi:BPMNPlane>
    </bpmndi:BPMNDiagram>
</definitions>