<?xml version="1.0" encoding="UTF-8"?>
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>65.0</apiVersion>
    <areMetricsLoggedToDataCloud>false</areMetricsLoggedToDataCloud>
    <assignments>
        <name>Set_Error</name>
        <label>Set Error</label>
        <locationX>440</locationX>
        <locationY>318</locationY>
        <assignmentItems>
            <assignToReference>varSuccess</assignToReference>
            <operator>Assign</operator>
            <value>
                <booleanValue>false</booleanValue>
            </value>
        </assignmentItems>
        <assignmentItems>
            <assignToReference>varErrorMessage</assignToReference>
            <operator>Assign</operator>
            <value>
                <elementReference>$Flow.FaultMessage</elementReference>
            </value>
        </assignmentItems>
    </assignments>
    <assignments>
        <name>Set_Success</name>
        <label>Set Success</label>
        <locationX>176</locationX>
        <locationY>318</locationY>
        <assignmentItems>
            <assignToReference>varSuccess</assignToReference>
            <operator>Assign</operator>
            <value>
                <booleanValue>true</booleanValue>
            </value>
        </assignmentItems>
    </assignments>
    <description>Creates or updates a DatedConversionRate record. Called from ExchangeRateService via Flow.Interview. Flow DML is used because Apex DML is blocked on DatedConversionRate.</description>
    <interviewLabel>Create Dated Conversion Rate {!$Flow.CurrentDateTime}</interviewLabel>
    <label>Create Dated Conversion Rate</label>
    <processMetadataValues>
        <name>BuilderType</name>
        <value>
            <stringValue>LightningFlowBuilder</stringValue>
        </value>
    </processMetadataValues>
    <processType>AutoLaunchedFlow</processType>
    <recordCreates>
        <name>Create_DCR_Record</name>
        <label>Create DCR Record</label>
        <locationX>176</locationX>
        <locationY>158</locationY>
        <connector>
            <targetReference>Set_Success</targetReference>
        </connector>
        <faultConnector>
            <targetReference>Set_Error</targetReference>
        </faultConnector>
        <inputAssignments>
            <field>ConversionRate</field>
            <value>
                <elementReference>varConversionRate</elementReference>
            </value>
        </inputAssignments>
        <inputAssignments>
            <field>IsoCode</field>
            <value>
                <elementReference>varIsoCode</elementReference>
            </value>
        </inputAssignments>
        <inputAssignments>
            <field>StartDate</field>
            <value>
                <elementReference>varStartDate</elementReference>
            </value>
        </inputAssignments>
        <object>DatedConversionRate</object>
    </recordCreates>
    <runInMode>SystemModeWithoutSharing</runInMode>
    <start>
        <locationX>50</locationX>
        <locationY>0</locationY>
        <connector>
            <targetReference>Create_DCR_Record</targetReference>
        </connector>
    </start>
    <status>Active</status>
    <variables>
        <name>varConversionRate</name>
        <dataType>Number</dataType>
        <isCollection>false</isCollection>
        <isInput>true</isInput>
        <isOutput>false</isOutput>
        <scale>6</scale>
    </variables>
    <variables>
        <name>varErrorMessage</name>
        <dataType>String</dataType>
        <isCollection>false</isCollection>
        <isInput>false</isInput>
        <isOutput>true</isOutput>
    </variables>
    <variables>
        <name>varIsoCode</name>
        <dataType>String</dataType>
        <isCollection>false</isCollection>
        <isInput>true</isInput>
        <isOutput>false</isOutput>
    </variables>
    <variables>
        <name>varStartDate</name>
        <dataType>Date</dataType>
        <isCollection>false</isCollection>
        <isInput>true</isInput>
        <isOutput>false</isOutput>
    </variables>
    <variables>
        <name>varSuccess</name>
        <dataType>Boolean</dataType>
        <isCollection>false</isCollection>
        <isInput>false</isInput>
        <isOutput>true</isOutput>
        <value>
            <booleanValue>false</booleanValue>
        </value>
    </variables>
</Flow>
