Digital Commerce Batch Jobs
Digital Commerce APIs rely on the cache data populated by the batch jobs in the persistent cache layer. Each batch job has its own separation of concerns regarding the type of cache data they populate. Digital Commerce APIs rely on the cache data populated by the batch jobs in the persistent cache layer. Each batch job has its own separation of concerns regarding the type of cache data they populate.
The cache populated during the batch time includes:
-
Catalog profile data (catalog information, products, promotions under that catalog).
-
Context combination of the cacheable context dimension with the corresponding eligibility list.
-
The list of offers that contains an offer.
-
The prices of each product or promotional product along with the override information.
-
Flat hierarchy of the product bundle, etc.
Pre-populating the cache data not only reduces the time complexity and overall SOQL during the run-time, but also acts as a source of truth for most of the APIs.
With versioning enabled, there can be different product versions and different promotional product versions associated with the catalog and promotion. The source of truth becomes the timeSliceInfo cache data populated by the Version Info Generator batch job that holds the information about the product and promotional products versions associated with the catalog at the given point of time.
As such, the batch jobs divides into three categories:
-
Catalog level batches - Information cached per catalog time slice: The catalog level batches are the type of batches that run at the catalog level and operate on the list of offers (Root products only) associated with the catalog. Therefore, catalog level batches are time bound as per the listed offer’s effectivity. Their cache effectivity date is that of the time slice information on which they are operating. The catalog level batches are:
-
Ecomm Data Profile
-
Context Eligibility Generator
-
GetOffers List Batch job
-
-
Offer level batches - Information cached per offer time slice: For the batch jobs concerned with the information about a particular offer, for example, offerDetails, the effectivity corresponds to the version effectivity dates of itself and the time slices generated by the versions of its children.
-
Get Offers Item
-
Get Hierarchy
-
Get Offer Details
-
-
Information cached for the entire effectivity dates: The data holding a reference to the actual sObjects (products or promotions) can be cached for the entire duration. For example, each rule for rule set expressions has some rule conditions with rule expressions to evaluate whether the rule passes or fails. The Digital Commerce getOffers API, references the qualifying rule sets that are associated with a product. Those rule expressions for a rule set can be cached for the entire cache duration.
-
Rule set expressions
-
GetPrices
-
There are catalog-level batch jobs that rely on the information cached by offer-level batches. For example, the getContains offers batch job lists the offers containing a product in the hierarchy. It returns the lists of catalog products and promotions. Therefore, the getContains offers batch job must be time-sliced according to all offer versions but it also depends on the individual offer version because the hierarchy of the product might change to a different version.
The following diagram shows an overview of the different types of cache data generated by the batch jobs (y-axis) vs timeline (x-axis) of the data set.