Newer Version Available
BatchProcessJobDefinition
File Suffix and Directory Location
BatchProcessJobDefinition components have the suffix .batchProcessJobDefinition and are stored in the batchProcessJobDefinitions folder.
Version
BatchProcessJobDefinition components are available in API version 51.0 and later.
Special Access Rules
To use this metadata type, your Salesforce org must have the Loyalty Management or the Rebate Management license.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| batchSize | integer | Required. Number of records that each Batch Management job can process. Each batch job can process up to 200 records. |
| dataSource | BatchDataSource[] | Required. Source of information whose records must be processed by the Batch Management job. |
| description | string | Description of the Batch Management job, up to 255 characters. |
| flowApiName | string | Required. API name of an active flow process that executes the batch job. |
| flowInputVariable | string | Required. Input variable of associated flow that is used by the batch job. |
| masterLabel | string | Required. Name of the Batch Management job, up to 80 characters. |
| processGroup | string | Required. Name of the group for which the Batch Management job processes records. |
| retryCount | integer | Required. Number of times this Batch Management job must be rerun in case it fails. The maximum retry count is 3. Valid values are 1 to 3. |
| retryInterval | integer | Required. Number of milliseconds after which the Batch Management job must be rerun in case it fails. Valid values are 1,000 to 10,000. |
| status | string | Indicates the status of the Batch Management job. Valid values are Active and Inactive. |
Represents the source of information whose records must be processed by the Batch Management job.
Fields
| Field Name | Field Type | Description |
|---|---|---|
| condition | string | Required. Criteria defined to filter the records. |
| criteria | string | Type of filter criteria that’s used to filter records for processing. |
| filters | BatchDataSrcFilterCriteria[] | Filter criterion that decides which records must be processed by the Batch Management job. |
| sourceObject | string | Required. API name of an object whose records must be processed by the batch job. |
Represents the filter conditions that decide which records must be processed by the Batch Management job.
Fields
Declarative Metadata Sample Definition
The following is an example of a BatchProcessJobDefinition component.
1<?xml version="1.0" encoding="UTF-8"?>
2<BatchProcessJobDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
3 <batchSize>10</batchSize>
4 <dataSource>
5 <condition>1</condition>
6 <criteria>all</criteria>
7 <filters>
8 <dynamicValue>false</dynamicValue>
9 <dynamicValueType>string</dynamicValueType>
10 <fieldName>Name</fieldName>
11 <fieldValue>abcd</fieldValue>
12 <operator>equals</operator>
13 <sequenceNo>1</sequenceNo>
14 </filters>
15 <sourceObject>Account</sourceObject>
16 </dataSource>
17 <flowApiName>Flow1</flowApiName>
18 <flowInputVariable>recordId</flowInputVariable>
19 <masterLabel>BatchJob1</masterLabel>
20 <processGroup>Loyalty</processGroup>
21 <retryCount>2</retryCount>
22 <retryInterval>1000</retryInterval>
23 <status>Inactive</status>
24 <description>test</description>
25</BatchProcessJobDefinition>The following is an example of a Flow object used in Metadata API.
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 ~ Copyright 2020 salesforce.com, inc.
4 ~ All Rights Reserved
5 ~ Company Confidential
6-->
7<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
8 <apiVersion>51.0</apiVersion>
9 <interviewLabel>Flow1 {!$Flow.CurrentDateTime}</interviewLabel>
10 <label>Flow1</label>
11 <processMetadataValues>
12 <name>BuilderType</name>
13 <value>
14 <stringValue>LightningFlowBuilder</stringValue>
15 </value>
16 </processMetadataValues>
17 <processMetadataValues>
18 <name>OriginBuilderType</name>
19 <value>
20 <stringValue>LightningFlowBuilder</stringValue>
21 </value>
22 </processMetadataValues>
23 <processType>AutoLaunchedFlow</processType>
24 <recordLookups>
25 <name>getAcc</name>
26 <label>getAcc</label>
27 <locationX>614</locationX>
28 <locationY>465</locationY>
29 <assignNullValuesIfNoRecordsFound>false</assignNullValuesIfNoRecordsFound>
30 <filterLogic>and</filterLogic>
31 <filters>
32 <field>Id</field>
33 <operator>EqualTo</operator>
34 <value>
35 <elementReference>recordId</elementReference>
36 </value>
37 </filters>
38 <getFirstRecordOnly>true</getFirstRecordOnly>
39 <object>Account</object>
40 <storeOutputAutomatically>true</storeOutputAutomatically>
41 </recordLookups>
42 <start>
43 <locationX>73</locationX>
44 <locationY>213</locationY>
45 <connector>
46 <targetReference>getAcc</targetReference>
47 </connector>
48 </start>
49 <status>Draft</status>
50 <variables>
51 <name>recordId</name>
52 <dataType>String</dataType>
53 <isCollection>false</isCollection>
54 <isInput>true</isInput>
55 <isOutput>false</isOutput>
56 </variables>
57</Flow>The following is an example package.xml that references the previous definition.
1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3 <types>
4 <members>*</members>
5 <name>BatchProcessJobDefinition</name>
6 </types>
7 <types>
8 <members>Flow1</members>
9 <name>Flow</name>
10 </types>
11 <version>51.0</version>
12</Package>Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.