Regenerate Cache APIs

A set of three REST APIs is available to regenerate the API cache. This section describes each of the regenerate cache APIs.

Before you begin the regenerate cache job, prepare and initialize the CPQ API cache.

You must invoke all of them in the correct order, with one conditional exception.

API Name

Description

Get Catalog Change API

Defines all offer and availability changes applicable to your catalogs, including changes that impact eligibility or effectivity. Examples include offer or bundle modifications such as changes in description, attachments, and cardinality.

Derive Change Entities API

Derives the scope of the impacted cache records from the CachedAPIChangeIds passed from the previous API to this API's request body.

Affected Cache API

Gets the cached records affected by the cachedAPIChange objects derived from the CachedAPIChangeIds passed from the previous API to this API's request body as a post method.

There are up to 3 different API calls provided by the action nodes of this API's response. They are invalidateAction, generateAction, and regenerateAction.

They must be executed with the invalidateAction calls first, followed by the generateAction calls, and finally the regenerateAction calls. In some cases, you will not need to perform generateAction calls, and you will not receive a corresponding node.

The cachedAPIChangeIds received from the previous API should be provided in the request body for this API. This API gets the cached records that will be affected by the derived cachedAPIChange objects.

  • Invalidate Affected Response API: Invalidates inaccurate cache entries based on the cachedAPIResponseIds passed from the invalidateAction node in the Get Affected Cache API's response.

  • Generate Affected Response API: Generates cache entries based on the cachedAPIResponseIds passed from the generateAction node in the Get Affected Cache API's response, if this node exists.

    Any apiNames values under the Get Affected Cache API's generateAction node indicate which Populate Cache APIs you must invoke again, in order. For example, the apiNames value catalogprofile indicates that you must invoke the Catalog Profile API.

  • Regenerate Affected Response API: You must invoke this API for each regenerateAction node in the Get Affected Cache API's response in the chronological Sequence listed. For example, invoke it for the node with Sequence: 8, then the node with Sequence: 9, and so on. You must append the ChangeEntryId parameter and its value to this API's URI.

The diagram shows the invocation order and the data passed between APIs.

invocation order and the data passed between APIs

Before you begin using these APIs, complete the following steps, and complete steps 1 to 3 before you make any catalog changes.

  1. Enable Cache Management in your Custom Settings:

    1. From Setup, in the Quick Find box, enter Custom Settings.

    2. Click Custom Settings.

    3. Go to Trigger Setup.

    4. Next to Trigger Setup, click Manage. The Trigger Setup page appears.

    5. Click Edit beside CacheAPI.CacheManagement, and turn on the trigger.

      If you do not see a trigger for CacheAPI.CacheManagement:

      • Click New.

      • Enter CacheAPI.CacheManagement in the Name field.

      • Click Trigger On.

      • Click Save.

  2. Set the following CPQ Configuration Custom Settings:

    1. Click the App Launcher.

    2. Click Vlocity CMT Administration.

    3. Under Custom Settings, click CPQ Configuration Setup.

    4. Create the CacheAPI.RegenerateBatchCacheProcessor setting and set its value to True:

  3. Ensure the following picklist values are added to their appropriate object fields specified here:

    • CachedAPIChange: vlocity_cmtChangeTypec

    • CachedAPIChange: vlocity_cmtCodeTypec

  4. Run the following Maintenance Jobs from Vlocity CMT Administration:

  5. Perform these additional requirements for using the Regenerate Cache APIs:

    • Run the maintenance jobs listed in step 4 anytime you must execute the Regenerate Cache APIs.

    • Populate the API cache using the populate cache APIs. Do not use the Vlocity CMT Administration Cacheable API Jobs (batch APEX) while using the cache management APIs. Use either the batch APEX jobs or the cache management APIs, not both.

    • Execute all of the regenerate cache APIs in the chronological order presented.

    • Ensure you do not modify your catalog or product offerings until you have executed all of the regenerate cache APIs.