The Derive Change Entities API derives the scope of the impacted entities from the unprocessed CachedAPIChange Ids received from the GetCatalog Change API.
This API takes the catalog changes as input in the request body and derives the scope of the impacted cache records. For example, if you modified the pricing of an offer due to the PriceListEntry(PLE) change, then the impacted scope entity would be the pricing of the offer to which that PLE is associated and the baskets containing that offer.
You can obtain the List<cachedAPIChangeIds> or cachedAPIChangeIds required in the request body of this API from the cachedAPIChangeIds node in the response body of the GetCatalog Change API.
Precondition
You must first run the GetCatalog Change API to obtain the List<cachedAPIChangeIds> or cachedAPIChangeIds required in the request body of this API.
This is an example of how you invoke the API using Apex:
1String methodName;2Map<String, Object> input = new Map<String, Object>();3Map<String, Object> output = new Map<String, Object>();4Map<String, Object> options = new Map<String, Object>();5// Setting remote parameters6methodName = 'deriveChangeEntity';7input.put('methodName',methodName);//required8input.put('apiName','regenerate'); //requires9List<Id> cachedAPIChangeMap = new List<Id>();10cachedAPIChangeMap.add('a4Q5g000000TmnaEAC');11input.put('cachedAPIChangeIds',cachedAPIChangeMap); //required12//remote action invocation13jk_232_cam.CpqAppHandler appHandler = new jk_232_cam.CpqAppHandler();14appHandler.invokeMethod(methodName, input, output, options);
Parallel Invocation
You can run this API in parallel for different cachedAPIChangeIds. For example, if there are 100 unprocessed cachedAPIChange entries from GetCatalogChangeAPI (CAC1, CAC2…CAC100), you can run parallel threads of the Derive Change API with each individual cachedAPIChangeIds.
1THREAD1 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange2 Body : {"cachedAPIChangeIds":CAC1}3THREAD2 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange4 Body : {"cachedAPIChangeIds":CAC2}5THREAD3 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange6 Body : {"cachedAPIChangeIds":CAC3}7.8.9.10.11THREAD100 - POST /services/apexrest/vlocity_cmt/v3/admin/catalogs/regenerate/deriveChange12 Body : {"cachedAPIChangeIds":CAC100}
If you are executing APIs in parallel using an orchestrator, you must use the uniqueDeriveIds parameter. This parameter ensures that duplicate records are not created and processed.
The return status indicates success or failure with a reason for the error. List<Id> of records contains the unprocessed Id of the CachedAPIChange__c object.