<?xml version="1.0" encoding="UTF-8"?>
<ApprovalProcess xmlns="http://soap.sforce.com/2006/04/metadata">
    <active>false</active>
    <allowRecall>false</allowRecall>
    <allowedSubmitters>
        <type>owner</type>
    </allowedSubmitters>
    <allowedSubmitters>
        <submitter>USSalesRep</submitter>
        <type>role</type>
    </allowedSubmitters>
    <allowedSubmitters>
        <submitter>MarketingGroup</submitter>
        <type>group</type>
    </allowedSubmitters>
    <allowedSubmitters>
        <submitter>kcooper@example.com</submitter>
        <type>user</type>
    </allowedSubmitters>
    <approvalPageFields>
        <field>Name</field>
        <field>Owner</field>
        <field>MyLeadCustomField__c</field>
        <field>Address</field>
    </approvalPageFields>
    <approvalStep>
        <allowDelegate>false</allowDelegate>
        <approvalActions>
            <action>
                <name>LeadApprovedTask1</name>
                <type>Task</type>
            </action>
            <action>
                <name>LeadApprovedTask2</name>
                <type>Task</type>
            </action>
        </approvalActions>
        <assignedApprover>
            <approver>
                <type>adhoc</type>
            </approver>
        </assignedApprover>
        <label>Step1</label>
        <name>Step1</name>
        <rejectionActions>
            <action>
                <name>LeadRejectedTask</name>
                <type>Task</type>
            </action>
        </rejectionActions>
    </approvalStep>
    <approvalStep>
        <allowDelegate>false</allowDelegate>
        <assignedApprover>
            <approver>
                <type>userHierarchyField</type>
            </approver>
        </assignedApprover>
        <entryCriteria>
            <criteriaItems>
                <field>Lead.CreatedDate</field>
                <operation>greaterThan</operation>
                <value>3/25/2013</value>
            </criteriaItems>
            <criteriaItems>
                <field>User.IsActive</field>
                <operation>notEqual</operation>
                <value>true</value>
            </criteriaItems>
        </entryCriteria>
        <ifCriteriaNotMet>ApproveRecord</ifCriteriaNotMet>
        <label>Step2</label>
        <name>Step2</name>
        <rejectBehavior>
            <type>RejectRequest</type>
        </rejectBehavior>
    </approvalStep>
    <approvalStep>
        <allowDelegate>true</allowDelegate>
        <assignedApprover>
            <approver>
                <name>MarketingTeamQueue</name>
                <type>queue</type>
            </approver>
            <approver>
                <name>LastModifiedBy</name>
                <type>relatedUserField</type>
            </approver>
            <approver>
                <name>awheeler@example.com</name>
                <type>user</type>
            </approver>
            <whenMultipleApprovers>FirstResponse</whenMultipleApprovers>
        </assignedApprover>
        <entryCriteria>
            <formula>CONTAINS( MyLeadCustomField__c , 'Salesforce')</formula>
        </entryCriteria>
        <label>Step3</label>
        <name>Step3</name>
        <rejectBehavior>
            <type>BackToPrevious</type>
        </rejectBehavior>
    </approvalStep>
    <emailTemplate>MyFolder/LeadsNewassignmentnotification</emailTemplate>
    <enableMobileDeviceAccess>false</enableMobileDeviceAccess>
    <entryCriteria>
        <criteriaItems>
            <field>Lead.AnnualRevenue</field>
            <operation>greaterThan</operation>
            <value>10500</value>
        </criteriaItems>
        <criteriaItems>
            <field>Lead.MyLeadCustomField__c</field>
            <operation>equals</operation>
            <value>Salesforce</value>
        </criteriaItems>
    </entryCriteria>
    <finalApprovalActions>
        <action>
            <name>LeadEmailContacted</name>
            <type>Alert</type>
        </action>
    </finalApprovalActions>
    <finalApprovalRecordLock>true</finalApprovalRecordLock>
    <finalRejectionActions>
        <action>
            <name>ProcessRejectedMessageAction</name>
            <type>OutboundMessage</type>
        </action>
    </finalRejectionActions>
    <finalRejectionRecordLock>false</finalRejectionRecordLock>
    <initialSubmissionActions>
        <action>
            <name>LeadFieldUpdate</name>
            <type>FieldUpdate</type>
        </action>
        <action>
            <name>NewLeadEmail</name>
            <type>Alert</type>
        </action>
    </initialSubmissionActions>
    <label>SampleProcess</label>
    <nextAutomatedApprover>
        <useApproverFieldOfRecordOwner>false</useApproverFieldOfRecordOwner>
        <userHierarchyField>customlookupuserfield__c</userHierarchyField>
    </nextAutomatedApprover>
    <postTemplate>MyPostTemplate</postTemplate>
    <recallActions>
        <action>
            <name>ProcessRecalledMessageAction</name>
            <type>OutboundMessage</type>
        </action>
    </recallActions>
    <recordEditability>AdminOnly</recordEditability>
    <showApprovalHistory>false</showApprovalHistory>
</ApprovalProcess>
