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:
-
Create the following Apex class. For information on creating Apex classes, see Define Apex Classes.
global class CustomCacheDataImplementation implements vlocity_cmt.VlocityOpenInterface { private vlocity_cmt.VOIInvoker invoker = vlocity_cmt.VOIInvoker.getInstance(); private vlocity_cmt.VlocityOpenInterface voi = (vlocity_cmt.VlocityOpenInterface)invoker.invoke('DefaultGetCacheDataImplementation', 'debugCreate', null, null, null); global Boolean invokeMethod(String methodName, Map<String, Object> input, Map<String, Object> output, Map<String, Object> options) { normalizeApiName(); voi.invokeMethod(methodName ,input, output, options); return true; } private void normalizeApiName() { if(vlocity_cmt.FlowStaticMap.flowMap.get('apiName') != null) { String apiName = (String) vlocity_cmt.FlowStaticMap.flowMap.get('apiName'); switch on apiName { when 'getOffers'{ vlocity_cmt.FlowStaticMap.flowMap.put('apiName','GetOffers'); } when 'getOfferDetails' { vlocity_cmt.FlowStaticMap.flowMap.put('apiName','GetOfferDetails'); } when 'getContainOffers'{ vlocity_cmt.FlowStaticMap.flowMap.put('apiName','GetContainOffers'); } } } } } -
Create an Interface Implementation.
-
Interface Name:
GetCacheData -
Active Implementation Class:
CustomCacheDataImplementation
-
-
For the Interface Implementation, create an Interface Implementation Detail with the Available Implementation of
CustomCacheDataImplementation.
Optimize the Cache Catalog Product Definition job.
-
Click the
icon and then Developer Console. -
Create a configuration snapshot.
vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController(); Map<String, String> input = new Map<String, String>(); input.put('startDateTime', DateTime.now().format()); input.put('endDateTime', DateTime.now().addDays(30).format()); controller.invokeMethod('createConfigurationSnapshot',input); -
Populate the cache for the getOfferDetails and getOffersByCatalogCodeAPIs by running steps 1 - 8 in Workflow for Using the Cache Management API Sample Orchestrator.
-
Activate the configuration snapshot.
vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController(); Map<String, String> input = new Map<String, String>(); controller.invokeMethod('activateConfigurationSnapshot',input);If you see any errors when populating the cache, you can abort the process.
vlocity_cmt.TelcoAdminConsoleController controller = new vlocity_cmt.TelcoAdminConsoleController(); Map<String, String> input = new Map<String, String>(); controller.invokeMethod('abortConfigurationSnapshot',input);
important: 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.