<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             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="20200429154814" modeler:modelId="1067098" modeler:modelVersion="2"
             modeler:modelLastUpdated="1588171685304">
    <process id="privacy-extension-release-process" name="privacy-extension-release-process" isExecutable="true">
        <documentation>This business process runs when the Subject Access Request enters the Release queue.</documentation>
        <startEvent id="startEvent1" name="Start"/>
        <sequenceFlow id="sid-A1A80BC3-B3F3-472A-8187-6EF2428E1D51" sourceRef="startEvent1"
                      targetRef="sid-F88A33F4-A31E-43B6-A65C-0921762C023D"/>
        <serviceTask id="sid-F88A33F4-A31E-43B6-A65C-0921762C023D" name="Place Subject Access Request in Release queue"
                     activiti:expression="#{queueCaseService.enqueue(OBJECT_ID, 'Release')}"/>
        <exclusiveGateway id="sid-BA57E0F7-613C-4E81-BA50-91677F22A0D2"/>
        <sequenceFlow id="SequenceFlow_1vtxmx2" sourceRef="Task_1ue461c" targetRef="sid-2158CAAD-78C1-465F-B109-70C2FCF1FF39"/>
        <sequenceFlow id="sid-245C25BE-925A-401F-BBD8-444BBC0755E7" name="Denied Request"
                      sourceRef="sid-BA57E0F7-613C-4E81-BA50-91677F22A0D2" targetRef="sid-2158CAAD-78C1-465F-B109-70C2FCF1FF39">
            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${OBJECT_DENIED_FLAG}]]></conditionExpression>
        </sequenceFlow>
        <sequenceFlow id="sid-143EE0F7-EF1E-4392-A580-3E552A262A27" name="Other Requests"
                      sourceRef="sid-BA57E0F7-613C-4E81-BA50-91677F22A0D2" targetRef="sid-C5A79729-8BB7-431C-AB69-7A5A2F2F81E3">
            <conditionExpression xsi:type="tFormalExpression"><![CDATA[${!OBJECT_DENIED_FLAG}]]></conditionExpression>
        </sequenceFlow>
        <sequenceFlow id="sid-7C860A67-DA43-4076-B2BE-B87497585AF2" sourceRef="sid-F88A33F4-A31E-43B6-A65C-0921762C023D"
                      targetRef="sid-BA57E0F7-613C-4E81-BA50-91677F22A0D2"/>
        <serviceTask id="sid-C5A79729-8BB7-431C-AB69-7A5A2F2F81E3" name="Convert the Response folder"
                     activiti:expression="#{responseFolderConverterService.convertResponseFolder(OBJECT_ID, USERNAME)}"/>
        <sequenceFlow id="sid-C6395A53-D720-4191-9FAB-41B52B5EED79" sourceRef="sid-C5A79729-8BB7-431C-AB69-7A5A2F2F81E3"
                      targetRef="sid-59B480D3-8042-491C-89F9-A490BC2B8106"/>
        <serviceTask id="sid-59B480D3-8042-491C-89F9-A490BC2B8106" name="Compress the Response folder"
                     activiti:expression="#{responseFolderCompressorService.compressResponseFolder(OBJECT_ID)}"
                     activiti:resultVariable="compressFolderPath"/>
        <sequenceFlow id="sid-c6395a53-d720-4191-9fab-41b52b5eed79" sourceRef="sid-59B480D3-8042-491C-89F9-A490BC2B8106"
                      targetRef="sid-e81ce45d-afdf-4c11-aadf-c70166212249"/>
        <serviceTask id="sid-e81ce45d-afdf-4c11-aadf-c70166212249" name="Send the compressed Response folder file to outbound message queue"
                     activiti:expression="#{sarFileBrokerClient.sendReleaseFile(OBJECT_ID, compressFolderPath)}"/>
        <sequenceFlow id="sid-3348156b-6d27-4e6f-9a8a-760829098468" sourceRef="sid-e81ce45d-afdf-4c11-aadf-c70166212249"
                      targetRef="Task_1ue461c"/>
        <serviceTask id="Task_1ue461c" name="Send Email notification"
                     activiti:expression="#{responseFolderNotifyService.sendEmailNotification(OBJECT_ID)}"/>
        <endEvent id="sid-2158CAAD-78C1-465F-B109-70C2FCF1FF39" name="End"/>

        <textAnnotation id="sid-4F2F594A-1B88-4975-BE9D-6A00AC08AACD">
            <text>
                This process orchestrates all the actions needed when a Subject Access Request is entering the Release queue. Currently there are 5
                such actions:

                1. Set the queue name to 'Release'
                2. Converts the 'Response' folder for non denied requests
                3. Compress the 'Response' folder for non denied requests
                4. Send the compressed 'Response' folder file to outbound message queue for non denied requests
                5. Send Email notification for non denied requests
            </text>
        </textAnnotation>
    </process>
    <bpmndi:BPMNDiagram id="BPMNDiagram_privacy-extension-release-process">
        <bpmndi:BPMNPlane bpmnElement="privacy-extension-release-process" id="BPMNPlane_privacy-extension-release-process">
            <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1">
                <omgdc:Bounds height="30.0" width="30.0" x="60.0" y="162.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="165.0" y="137.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-BA57E0F7-613C-4E81-BA50-91677F22A0D2"
                              id="BPMNShape_sid-BA57E0F7-613C-4E81-BA50-91677F22A0D2">
                <omgdc:Bounds height="40.0" width="40.0" x="315.0" y="157.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-C5A79729-8BB7-431C-AB69-7A5A2F2F81E3"
                              id="BPMNShape_sid-C5A79729-8BB7-431C-AB69-7A5A2F2F81E3">
                <omgdc:Bounds height="80.0" width="105.0" x="405.0" y="136.5"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-59B480D3-8042-491C-89F9-A490BC2B8106"
                              id="BPMNShape_sid-59B480D3-8042-491C-89F9-A490BC2B8106">
                <omgdc:Bounds height="80.0" width="105.0" x="570.0" y="136.5"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-e81ce45d-afdf-4c11-aadf-c70166212249"
                              id="BPMNShape_sid-e81ce45d-afdf-4c11-aadf-c70166212249">
                <omgdc:Bounds height="79.0" width="124.6875" x="735.0" y="137.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="Task_1ue461c" id="BPMNShape_Task_1ue461c">
                <omgdc:Bounds height="80.0" width="105.0" x="915.0" y="137.5"/>
            </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="953.5" y="343.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNShape bpmnElement="sid-4F2F594A-1B88-4975-BE9D-6A00AC08AACD"
                              id="BPMNShape_sid-4F2F594A-1B88-4975-BE9D-6A00AC08AACD">
                <omgdc:Bounds height="240.0" width="203.0" x="67.0" y="255.0"/>
            </bpmndi:BPMNShape>
            <bpmndi:BPMNEdge bpmnElement="sid-7C860A67-DA43-4076-B2BE-B87497585AF2" id="BPMNEdge_sid-7C860A67-DA43-4076-B2BE-B87497585AF2">
                <omgdi:waypoint x="265.0" y="177.0"/>
                <omgdi:waypoint x="315.0" y="177.0"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-245C25BE-925A-401F-BBD8-444BBC0755E7" id="BPMNEdge_sid-245C25BE-925A-401F-BBD8-444BBC0755E7">
                <omgdi:waypoint x="335.0" y="197.0"/>
                <omgdi:waypoint x="335.0" y="357.0"/>
                <omgdi:waypoint x="953.5" y="357.0"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-3348156b-6d27-4e6f-9a8a-760829098468" id="BPMNEdge_sid-3348156b-6d27-4e6f-9a8a-760829098468">
                <omgdi:waypoint x="859.6875" y="176.866391184573"/>
                <omgdi:waypoint x="915.0" y="177.19146005509643"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-c6395a53-d720-4191-9fab-41b52b5eed79" id="BPMNEdge_sid-c6395a53-d720-4191-9fab-41b52b5eed79">
                <omgdi:waypoint x="675.0" y="176.5"/>
                <omgdi:waypoint x="735.0" y="176.5"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-C6395A53-D720-4191-9FAB-41B52B5EED79" id="BPMNEdge_sid-C6395A53-D720-4191-9FAB-41B52B5EED79">
                <omgdi:waypoint x="510.0" y="176.5"/>
                <omgdi:waypoint x="570.0" y="176.5"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-143EE0F7-EF1E-4392-A580-3E552A262A27" id="BPMNEdge_sid-143EE0F7-EF1E-4392-A580-3E552A262A27">
                <omgdi:waypoint x="354.9186991869919" y="176.91869918699186"/>
                <omgdi:waypoint x="405.0" y="176.71428571428572"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="sid-A1A80BC3-B3F3-472A-8187-6EF2428E1D51" id="BPMNEdge_sid-A1A80BC3-B3F3-472A-8187-6EF2428E1D51">
                <omgdi:waypoint x="90.0" y="177.0"/>
                <omgdi:waypoint x="165.0" y="177.0"/>
            </bpmndi:BPMNEdge>
            <bpmndi:BPMNEdge bpmnElement="SequenceFlow_1vtxmx2" id="BPMNEdge_SequenceFlow_1vtxmx2">
                <omgdi:waypoint x="967.5" y="217.5"/>
                <omgdi:waypoint x="967.5" y="343.0"/>
            </bpmndi:BPMNEdge>
        </bpmndi:BPMNPlane>
    </bpmndi:BPMNDiagram>
</definitions>