<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>62.0</apiVersion>
    <decisions>
        <name>Check_Approver</name>
        <label>Check Approver</label>
        <locationX>578</locationX>
        <locationY>503</locationY>
        <defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
        <rules>
            <name>Lonny_Approval</name>
            <conditionLogic>or</conditionLogic>
            <conditions>
                <leftValueReference>$Record.MasterApproverId__r.Name</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Lonny Olinick</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$User.Username</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>lonny.olinick@sonymusic.com</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_Lonny_Approval_Date</targetReference>
            </connector>
            <label>Lonny Approval</label>
        </rules>
        <rules>
            <name>Paul_Pete_Ben_Approval</name>
            <conditionLogic>or</conditionLogic>
            <conditions>
                <leftValueReference>$Record.MasterApproverId__r.Name</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Paul Hitchman</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$User.Username</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>paul.hitchman@awal.com</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.MasterApproverId__r.Name</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Pete Giberga</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$User.Username</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>pete.giberga@awal.com</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.MasterApproverId__r.Name</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Ben Akinbola</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$User.Username</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>ben.akinbola@awal.com</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_Paul_Pete_Ben_Approval_Date</targetReference>
            </connector>
            <label>Paul/Pete/Ben Approval</label>
        </rules>
    </decisions>
    <decisions>
        <name>Check_Recordtype</name>
        <label>Check Recordtype</label>
        <locationX>974</locationX>
        <locationY>287</locationY>
        <defaultConnectorLabel>Else</defaultConnectorLabel>
        <rules>
            <name>AWAL</name>
            <conditionLogic>and</conditionLogic>
            <conditions>
                <leftValueReference>$Record.RecordType.DeveloperName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>AWAL</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Check_Status</targetReference>
            </connector>
            <label>AWAL</label>
        </rules>
    </decisions>
    <decisions>
        <name>Check_Status</name>
        <label>Check Status</label>
        <locationX>578</locationX>
        <locationY>395</locationY>
        <defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
        <rules>
            <name>Finance</name>
            <conditionLogic>and</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>IsChanged</operator>
                <rightValue>
                    <booleanValue>true</booleanValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Finance Analysis Complete</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_Finance_Approval_Date</targetReference>
            </connector>
            <label>Finance</label>
        </rules>
        <rules>
            <name>Approved</name>
            <conditionLogic>and</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>IsChanged</operator>
                <rightValue>
                    <booleanValue>true</booleanValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Approved</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Check_Approver</targetReference>
            </connector>
            <label>Approved</label>
        </rules>
    </decisions>
    <environments>Default</environments>
    <interviewLabel>AWAL - Update Approval Date {!$Flow.CurrentDateTime}</interviewLabel>
    <label>AWAL - Update Approval Date</label>
    <processMetadataValues>
        <name>BuilderType</name>
        <value>
            <stringValue>LightningFlowBuilder</stringValue>
        </value>
    </processMetadataValues>
    <processMetadataValues>
        <name>CanvasMode</name>
        <value>
            <stringValue>AUTO_LAYOUT_CANVAS</stringValue>
        </value>
    </processMetadataValues>
    <processMetadataValues>
        <name>OriginBuilderType</name>
        <value>
            <stringValue>LightningFlowBuilder</stringValue>
        </value>
    </processMetadataValues>
    <processType>AutoLaunchedFlow</processType>
    <recordUpdates>
        <name>Update_Finance_Approval_Date</name>
        <label>Update Finance Approval Date</label>
        <locationX>50</locationX>
        <locationY>503</locationY>
        <inputAssignments>
            <field>ApprovalDate2__c</field>
            <value>
                <elementReference>$Flow.CurrentDate</elementReference>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <recordUpdates>
        <name>Update_Lonny_Approval_Date</name>
        <label>Update Lonny Approval Date</label>
        <locationX>314</locationX>
        <locationY>611</locationY>
        <inputAssignments>
            <field>ApprovalDate3__c</field>
            <value>
                <elementReference>$Flow.CurrentDate</elementReference>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <recordUpdates>
        <name>Update_Paul_Pete_Ben_Approval_Date</name>
        <label>Update Paul/Pete/Ben Approval Date</label>
        <locationX>578</locationX>
        <locationY>611</locationY>
        <inputAssignments>
            <field>ApprovalDate1__c</field>
            <value>
                <elementReference>$Flow.CurrentDate</elementReference>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <start>
        <locationX>848</locationX>
        <locationY>0</locationY>
        <connector>
            <targetReference>Check_Recordtype</targetReference>
        </connector>
        <filterLogic>and</filterLogic>
        <filters>
            <field>StageName</field>
            <operator>IsChanged</operator>
            <value>
                <booleanValue>true</booleanValue>
            </value>
        </filters>
        <object>Opportunity</object>
        <recordTriggerType>Update</recordTriggerType>
        <triggerType>RecordBeforeSave</triggerType>
    </start>
    <status>Active</status>
</Flow>
