<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>61.0</apiVersion>
    <areMetricsLoggedToDataCloud>false</areMetricsLoggedToDataCloud>
    <decisions>
        <name>Check_Recordtype</name>
        <label>Check Recordtype</label>
        <locationX>1568</locationX>
        <locationY>287</locationY>
        <defaultConnectorLabel>Default Outcome</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>Pre_existing_Records</targetReference>
            </connector>
            <label>AWAL</label>
        </rules>
    </decisions>
    <decisions>
        <name>Check_Stage</name>
        <label>Check Stage</label>
        <locationX>974</locationX>
        <locationY>887</locationY>
        <defaultConnectorLabel>Default Outcome</defaultConnectorLabel>
        <rules>
            <name>Deal_Tracking</name>
            <conditionLogic>or</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Deal Tracking</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_Deal_Tracking</targetReference>
            </connector>
            <label>Deal Tracking</label>
        </rules>
        <rules>
            <name>Deal_Discussions</name>
            <conditionLogic>or</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Deal Discussions</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_Deal_Discussions</targetReference>
            </connector>
            <label>Deal Discussions</label>
        </rules>
        <rules>
            <name>Passed_to_Finance</name>
            <conditionLogic>or</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Passed to Finance</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Finance Analysis Complete</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Passed to Finance Approver</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_Passed_to_Finance</targetReference>
            </connector>
            <label>Passed to Finance</label>
        </rules>
        <rules>
            <name>Passed_to_Approver</name>
            <conditionLogic>or</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Passed to Approver</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_Passed_to_Approver</targetReference>
            </connector>
            <label>Passed to Approver</label>
        </rules>
        <rules>
            <name>Approved</name>
            <conditionLogic>or</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Approved</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_Approved</targetReference>
            </connector>
            <label>Approved</label>
        </rules>
        <rules>
            <name>With_BA</name>
            <conditionLogic>or</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Passed to BA</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>With BA (Long Form)</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>With BA (Short Form)</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_With_BA</targetReference>
            </connector>
            <label>With BA</label>
        </rules>
        <rules>
            <name>Closed</name>
            <conditionLogic>or</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Closed Won</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Closed Lost</stringValue>
                </rightValue>
            </conditions>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>EqualTo</operator>
                <rightValue>
                    <stringValue>Closed - No Interest</stringValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Update_Closed</targetReference>
            </connector>
            <label>Closed</label>
        </rules>
    </decisions>
    <decisions>
        <name>New_Opportunity_Record</name>
        <label>New Opportunity Record?</label>
        <locationX>974</locationX>
        <locationY>395</locationY>
        <defaultConnector>
            <targetReference>Check_Stage</targetReference>
        </defaultConnector>
        <defaultConnectorLabel>Yes</defaultConnectorLabel>
        <rules>
            <name>No</name>
            <conditionLogic>and</conditionLogic>
            <conditions>
                <leftValueReference>Pre_existing_Records</leftValueReference>
                <operator>IsNull</operator>
                <rightValue>
                    <booleanValue>false</booleanValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Stage_has_Changed</targetReference>
            </connector>
            <label>No</label>
        </rules>
    </decisions>
    <decisions>
        <name>Stage_has_Changed</name>
        <label>Stage has Changed?</label>
        <locationX>798</locationX>
        <locationY>503</locationY>
        <defaultConnectorLabel>No</defaultConnectorLabel>
        <rules>
            <name>Yes</name>
            <conditionLogic>and</conditionLogic>
            <conditions>
                <leftValueReference>$Record.StageName</leftValueReference>
                <operator>IsChanged</operator>
                <rightValue>
                    <booleanValue>true</booleanValue>
                </rightValue>
            </conditions>
            <connector>
                <targetReference>Check_Stage</targetReference>
            </connector>
            <label>Yes</label>
        </rules>
    </decisions>
    <environments>Default</environments>
    <interviewLabel>AWAL - Update Path {!$Flow.CurrentDateTime}</interviewLabel>
    <label>AWAL - Update Path</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>
    <recordLookups>
        <name>Pre_existing_Records</name>
        <label>Pre existing Records</label>
        <locationX>974</locationX>
        <locationY>287</locationY>
        <assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
        <connector>
            <targetReference>New_Opportunity_Record</targetReference>
        </connector>
        <filterLogic>and</filterLogic>
        <filters>
            <field>Id</field>
            <operator>EqualTo</operator>
            <value>
                <elementReference>$Record.Id</elementReference>
            </value>
        </filters>
        <getFirstRecordOnly>true</getFirstRecordOnly>
        <object>Opportunity</object>
        <storeOutputAutomatically>true</storeOutputAutomatically>
    </recordLookups>
    <recordUpdates>
        <name>Update_Approved</name>
        <label>Update Approved</label>
        <locationX>1106</locationX>
        <locationY>995</locationY>
        <inputAssignments>
            <field>AWALStatusPath__c</field>
            <value>
                <stringValue>Approved</stringValue>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <recordUpdates>
        <name>Update_Closed</name>
        <label>Update Closed</label>
        <locationX>1634</locationX>
        <locationY>995</locationY>
        <inputAssignments>
            <field>AWALStatusPath__c</field>
            <value>
                <stringValue>Closed</stringValue>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <recordUpdates>
        <name>Update_Deal_Discussions</name>
        <label>Update Deal Discussions</label>
        <locationX>314</locationX>
        <locationY>995</locationY>
        <inputAssignments>
            <field>AWALStatusPath__c</field>
            <value>
                <stringValue>Deal Discussions</stringValue>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <recordUpdates>
        <name>Update_Deal_Tracking</name>
        <label>Update Deal Tracking</label>
        <locationX>50</locationX>
        <locationY>995</locationY>
        <inputAssignments>
            <field>AWALStatusPath__c</field>
            <value>
                <stringValue>Deal Tracking</stringValue>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <recordUpdates>
        <name>Update_Passed_to_Approver</name>
        <label>Update Passed to Approver</label>
        <locationX>842</locationX>
        <locationY>995</locationY>
        <inputAssignments>
            <field>AWALStatusPath__c</field>
            <value>
                <stringValue>Passed to Approver</stringValue>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <recordUpdates>
        <name>Update_Passed_to_Finance</name>
        <label>Update Passed to Finance</label>
        <locationX>578</locationX>
        <locationY>995</locationY>
        <inputAssignments>
            <field>AWALStatusPath__c</field>
            <value>
                <stringValue>Passed to Finance</stringValue>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <recordUpdates>
        <name>Update_With_BA</name>
        <label>Update With BA</label>
        <locationX>1370</locationX>
        <locationY>995</locationY>
        <inputAssignments>
            <field>AWALStatusPath__c</field>
            <value>
                <stringValue>With BA</stringValue>
            </value>
        </inputAssignments>
        <inputReference>$Record</inputReference>
    </recordUpdates>
    <start>
        <locationX>848</locationX>
        <locationY>0</locationY>
        <connector>
            <targetReference>Check_Recordtype</targetReference>
        </connector>
        <object>Opportunity</object>
        <recordTriggerType>CreateAndUpdate</recordTriggerType>
        <triggerType>RecordBeforeSave</triggerType>
    </start>
    <status>Active</status>
</Flow>
