The Salesforce Developers website will undergo maintenance on May 29, 2024 from 3:00 a.m. UTC to 10:00 a.m. UTC. The maintenance process may affect the availability of our documentation. Please plan accordingly.

Offer Level Batch Jobs

These types of batch jobs, for example, OfferDetails and Promotion Wrapper, cache information about a particular offer, such as a product or a promotion.

The Get Offers Item batch job generates the offer profile data used in the response of the getOffers API. This job generates the offers profile including name, code, priceKeys, attachment URLs, etc., and any extra fields that are added as a part of API metadata.

The system uses the versionInfo list populated by the versionInfo generator batch for a selected catalog with the list of offerIds (product, promotion, promotionItem) that are effective between a given start and end date. The offerProfile is calculated and cached with the version start and end date for a particular offer version. The offer profile for a product contains the details about the root offer, name, code, description, attribute category, etc. Details for a promotion offer type are populated for the promotion as well as the promotional products, not including its hierarchy.

Get Offers Item Batch Job

This GetPrices batch job generates and caches the pricing information for a product or a promotional product. These products can be a part of the catalog or part of the hierarchy of a product bundle belonging to the catalog. This batch job generates the price results of all the products and promotions that are part of the catalog, iterating through each catalog product relationship and generating the price results of each. The cache keys are the priceKeys against which the information for the product or promotion is cached and includes productId as a part of the key.

With versioning enabled, there can be different product versions with different priceListEntries for those between a selected start and end date. The batch job takes all the productIds, promotions, and promotionItemIds between the cache start and end dates, processes them, and caches the priceResults without pricing the same product twice but with different versions overlapping, so there is no inconsistent data. Each product version has its own Id, and priceKey contains the productId, so the versioning uptake in the priceResults are automatically included.

GetPrices Batch Job

The getContainsOffers batch job generates the cache entries for use by the Contains API for all products in a catalog that are part of another product hierarchy or linked as promotional items to a promotion. The batch job works on the data profile of each catalog. With versioning enabled, the number of data profiles for a catalog equals the number of time slices.

The catalog data profile changes according to the time slice. During the initialization phase, the first time slice is fetched and then the catalog data profile for each time slice is treated as input for the execution phase of the batch job.

In the execution phase for each time slice, the list product versions for the CPRs are processed to get the list of offers that contain a particular product version. The response is then created and populated by calculating the eligibility for each context dimension, paginated, and sorted.

GetContainsOffers Batch Job

The Hierarchy batch job caches the flat hierarchy of the products and promotional products associated with the catalog. This offerDetails batch uses this information to compute the details of the full hierarchy, including its child products, virtual products, promotional item overrides, offer overrides, etc. With versioning enabled, there can be multiple versions of the child products for a version of its parent and vice-versa.

The hierarchy level batch job caches the flat hierarchy of the catalog products, generates the time slices for that offer, and caches the hierarchy with the effectivity of the time slice. The offer level time-slicing applies to the hierarchy results.

The batch job first queries and gets the version info list from the cache, then gets the time slices from the data store object for each productId. The data store object has the effective start and end time to represent the time slice times for that offer. For each time slice, the batch job generates the flat hierarchy by filtering out orphaned child products and products that are in the draft state (not in the released state). If the restructuring of the time slices is required after the filtration of orphans and draft products, the system restructures, generates, and caches the hierarchy according to the offer time slice.

Hierarchy Batch Job

The promotion wrapper batch job generates the in-memory details of simple promotions, such as line items associated with promotions and adjustment details.

With versioning applied, you can have different promotion items for the same product for a given time slice, depending on the product version linked to the promotion. The hierarchy of the promotion items with their changes for line items is populated based on the time slice information. For a given promotion, the number of records generated equals the number of time slices.

PromotionWrapper Batch Job

The getOfferDetails batch job creates and caches the details of all the product offers and promotions in the catalog. This batch job generates details for the offer and the associated offer. For products, this batch job generates details for the root offer and any child products associated with the root offer for the full hierarchy. For promotions, this batch job generates details for the complete hierarchy of the promotional item.

With versioning enabled, when getting and processing the input records, each time slice can include different versions of the product. The number of batches for a product equals the number of time slices. For a given catalog, the total number of batches that run equals the number of catalog product relationships multiplied by the number of time slices. While populating the input record, the time slice effective date is stored and eventually used as the effective date for the cache entry for that version of the product.

The details generated for an offer remain the same but are generated for each version of the product. Details for promotions include the version of the promotion item.

GetOfferDetails Batch Job