Optimize the Cache Catalog Product Definition Job

Use the Cache Management API to speed up the Cache Catalog Product Definition job.

If your org is running the CME 240.9 package, run the following prerequisite steps:

  1. Create the following Apex class. For information on creating Apex classes, see Define Apex Classes.

    1global class CustomCacheDataImplementation implements vlocity_cmt.VlocityOpenInterface
    2{
    3    private vlocity_cmt.VOIInvoker invoker = vlocity_cmt.VOIInvoker.getInstance();
    4    private vlocity_cmt.VlocityOpenInterface voi = (vlocity_cmt.VlocityOpenInterface)invoker.invoke('DefaultGetCacheDataImplementation', 'debugCreate', null, null, null);
    5
    6    global Boolean invokeMethod(String methodName, Map<String, Object> input, Map<String, Object> output, Map<String, Object> options)
    7    {
    8        normalizeApiName();
    9        voi.invokeMethod(methodName ,input, output, options);
    10        return true;
    11    }
    12
    13    private void normalizeApiName()
    14    {
    15        if(vlocity_cmt.FlowStaticMap.flowMap.get('apiName') != null)
    16        {
    17            String apiName = (String) vlocity_cmt.FlowStaticMap.flowMap.get('apiName');
    18            switch on apiName
    19            {
    20                when 'getOffers'{
    21                    vlocity_cmt.FlowStaticMap.flowMap.put('apiName','GetOffers');
    22                }
    23
    24                when 'getOfferDetails' {
    25                    vlocity_cmt.FlowStaticMap.flowMap.put('apiName','GetOfferDetails');
    26                }
    27
    28                when 'getContainOffers'{
    29                    vlocity_cmt.FlowStaticMap.flowMap.put('apiName','GetContainOffers');
    30                }
    31            }
    32        }
    33    }
    34}
  2. Create an Interface Implementation.

    • Interface Name: GetCacheData

    • Active Implementation Class: CustomCacheDataImplementation

  3. For the Interface Implementation, create an Interface Implementation Detail with the Available Implementation of CustomCacheDataImplementation.

Optimize the Cache Catalog Product Definition job.

  1. Click the Gear icon and then Developer Console.

  2. Create a configuration snapshot.

    1vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController();
    2Map<String, String> input = new Map<String, String>();
    3input.put('startDateTime', DateTime.now().format());
    4input.put('endDateTime', DateTime.now().addDays(30).format());
    5controller.invokeMethod('createConfigurationSnapshot',input);
  3. Populate the cache for the getOfferDetails and getOffersByCatalogCodeAPIs by running steps 1 - 8 in Workflow for Using the Cache Management API Sample Orchestrator.

  4. Activate the configuration snapshot.

    1vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController();
    2Map<String, String> input = new Map<String, String>();
    3controller.invokeMethod('activateConfigurationSnapshot',input);

    If you see any errors when populating the cache, you can abort the process.

    1vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController();
    2Map<String, String> input = new Map<String, String>();
    3controller.invokeMethod('abortConfigurationSnapshot',input);

To optimize the Cache Catalog Product Definition Job’s operation and prevent any errors, it is recommended to ensure that all promotions in the catalog are active and orderable.

Important