BatchProcessJobDefinition

Represents the details of a Batch Management job definition.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

BatchProcessJobDefinition components have the suffix .batchProcessJobDefinition and are stored in the batchProcessJobDefinitions folder.

Version 

Introduced in API version 51.0.

Special Access Rules 

To know the products and user permissions needed to access this type, See Supported Editions and Permissions for Batch Management.

Fields 

batchSize 

  • Type: int
  • Required: Yes
  • Description: Required. Number of records that each Batch Management job can process. Flow type Batch Management jobs can process up to 2000 records and Loyalty Program Process type Batch Management jobs can process up to 250 records.

dataSource 

  • Type: BatchDataSource
  • Required: Yes
  • Description: Required. Source of information whose records must be processed by the Batch Management job.

description 

  • Type: string
  • Required: No
  • Description: Description of the Batch Management job, up to 255 characters.

executionProcessApiName 

  • Type: string

  • Required: No

  • Introduced: API version 55.0

  • Description:

    API name of process that must be executed by the Batch Management job. - If the batch job’s type is Flow, enter the API name of an active flow that the batch job must execute.

    • If the batch job’s type is Loyalty Program Process, enter:
      • Transaction_Journals if you want the batch job to process Transaction Journal records by applying the applicable active loyalty program process of the type TransactionJournal.
    • API name of an active loyalty process of the type TierProcessing if you want the batch job to run the loyalty program process to assess the tier of eligible members. The API name consists of the name of the process, the process type, and the name of the loyalty program separated by two consecutive underscores. For example, the process API name is Update Member Tier__TierProcessing__Inner Circle if the process name is Update Member Tier, the process type is TierProcessing, and the loyalty program name is Inner Circle.

    You can use database-based APEX classes that let you use flex queues in the Batch Management job, allowing to place more than 5 jobs in a queue. This functionality is applicable to all Industry Clouds that use managed packages. See Apex Flex Queue.

flowApiName 

  • Type: string

  • Required: No

  • Description: API name of an active flow process that must be executed by the Batch Management job.

    You can either specify the flow API name in the executionProcessApiName field or in the flowApiName field.

flowInputVariable 

  • Type: string
  • Required: No
  • Description: Input variable of associated flow that is used by the batch job to uniquely identify records.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. Name of the Batch Management job, up to 80 characters.

processGroup 

  • Type: string
  • Required: Yes
  • Description: Required. Name of the group for which the Batch Management job processes records.

retryCount 

  • Type: int
  • Required: Yes
  • Description: 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–3.

retryInterval 

  • Type: int
  • Required: Yes
  • Description: Required. Number of milliseconds after which the Batch Management job must be rerun in case it fails. Valid values are 1,000–10,000.

status 

  • Type: string
  • Required: No
  • Description: Indicates the status of the Batch Management job. Valid values are Active and Inactive.

type 

  • Type: string (enumeration of type string)
  • Required: No
  • Introduced: API version 55.0
  • Description: The type of process that the Batch Management job must execute.
  • Possible values:
    • BulkUpdate
    • Calc — Data Processing Engine
    • ConsumptionOveragesCalculation
    • DecisionTableRefresh
    • DeepCloneSalesAgreement
    • FlattenAccountIOUHierarchyBatchJob
    • Flow
    • EnergyUseRecordCreationBatchJob
    • EntitlementCreationBatchJob
    • HighScaleBreProcess
    • IndustriesLSCommercial
    • InvoiceDTPRunBatchJob
    • InvoiceRecoveryRunBatchJob
    • InvoiceRunBatchJob
    • LifeSciProviderActivityGoalSharingBatchJob
    • LoyaltyProgramProcess
    • NetUnitRateCalculation
    • NextGenCommitmentBatchProcessingJob
    • ManagerProvisioning
    • PbbToOptyConversion
    • ProductCatalogCacheRefresh
    • PromotionChannelPropagationBatchJob
    • RatableSummaryCreation
    • ServiceProcess
    • StoreAssortmentPropagationBatchJob
    • SummaryCreation
    • WorkDotComToHRManagerProvisioning

BatchDataSource Type 

Represents the source of information whose records must be processed by the Batch Management job.

Fields 

condition 

  • Type: string
  • Required: Yes
  • Description: Required. Criteria defined to filter the records.

criteria 

  • Type: string
  • Required: No
  • Description: Type of filter criteria that’s used to filter records for processing.

dataSourceType 

  • Type: DataSourceType (enumeration of type string)

  • Required: No

  • Introduced: API version 64.0

  • Description: Type of data source that’s used to create the batch job definition. Valid values are:

    • SingleSobject
    • MultiSobject
    • File—Available in API version 67.0 and later.

filters 

  • Type: BatchDataSrcFilterCriteria[]
  • Required: No
  • Description: Filter criterion that decides which records must be processed by the Batch Management job.

orderFields 

  • Type: BatchDataSourceOrderField[]
  • Required: No
  • Description: Fields that are used to order the records before the records are added to a batch in a job.

relatedSobjects 

  • Type: string
  • Required: No

sourceObject 

  • Type: string

  • Required: Yes

  • Description: Required. API name of an object whose records must be processed by the batch job.

    If the batch job type is Loyalty Program Process, the source object must be:

    • TransactionJournal if the batch job is used to process transaction journals by applying the applicable loyalty program process.
    • An object that stores the details of loyalty program members whose tier must be assessed by the loyalty program process specified in the executionProcessApiName field.

sourceObjectField 

  • Type: string
  • Required: No
  • Introduced: API version 57.0
  • Description: API name of the source object field that uniquely identifies records for which the batch job is executed. This field is only applicable when the batch job’s type is Loyalty Program Process and a TierProcess type active loyalty program process is specified in the executionProcessApiName field. Specify the API name of a field that is a lookup to the LoyaltyProgramMember object and uniquely identifies the members whose tier must be assessed.

BatchDataSourceOrderField Type 

Represents the fields that are used to group data.

Fields 

domainObjectName 

  • Type: string
  • Required: Yes
  • Introduced: API version 64.0
  • Description: Required. Name of the object the field is associated with.

fieldName 

  • Type: string
  • Required: Yes
  • Introduced: API version 64.0
  • Description: Required. Name of the field that must be used to filter records.

fieldPath 

  • Type: string
  • Required: Yes
  • Introduced: API version 64.0
  • Description: Required. Stores the path to a field in the object.

BatchDataSrcFilterCriteria Type 

Represents the filter conditions that decide which records must be processed by the Batch Management job.

Fields 

domainObjectName 

  • Type: string
  • Required: No
  • Introduced: API version 64.0
  • Description: Name of the object the field is associated with.

dynamicValue 

  • Type: boolean
  • Required: Yes
  • Description: Required. Indicates whether the filter criteria is dynamic.

dynamicValueType 

  • Type: string
  • Required: No
  • Description: Data type of the input variable used as a filter.

fieldName 

  • Type: string
  • Required: Yes
  • Description: Required. Name of the field that must be used to filter records.

fieldPath 

  • Type: string
  • Required: No
  • Introduced: API version 64.0
  • Description: Stores the path to a field in the object.

fieldValue 

  • Type: string
  • Required: Yes
  • Description: Required. Value of the field that must be filtered. Specify the field if dynamicValue is set to false.

operator 

  • Type: string (enumeration of type string)
  • Required: Yes
  • Description: Required. Operator that is specified in the filter criteria.
  • Possible values:
    • equals
    • excludes
    • greaterThan
    • greaterThanOrEqualTo
    • in
    • includes
    • lessThan
    • LessThanOrEqualTo
    • GreaterOrEqual
    • like
    • notEquals
    • notIn

sequenceNo 

  • Type: int
  • Required: Yes
  • Description: Required. Sequence number used to refer the criteria in a filter.

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   <type>Flow</type>
26   <executionProcessApiName>testFlow</executionProcessApiName>
27</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, 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.