Order Management comes with the XOMAsyncSystemInterface adapter. That adapter comes with the methods described here, which you can override to allow custom logic.
-
void executeItem(String url, String path, vlocity_cmt__OrchestrationItem__c item)-
The entry point for every adapter. It calls
generatePayload()to prepare the request, and callscreateHTTPRequest()to create an HTTP request. It sends the payload to the external system, analyzes the incoming response code, and callsprocessResponse()to process the response. -
Override this method if a different logic is needed.
-
-
String generatePayload(vlocity_cmt__OrchestrationItem__c item, vlocity_cmt.XOMOrderDomainObject orderObj)-
Creates a payload.
-
Override this method if a payload has to be generated differently, and existing configuration capabilities are not enough to make that change.
-
-
HttpRequest createHttpRequest(String url, String path, String requestPayload)-
Creates an HTTP request.
-
Override this method if a different HTTP method is required (for example, GET), or additional HTTP headers are needed.
-
-
void processResponse(OrchestrationItem__c item, String url, String path, XOMOrderDomainObject orderObj, HttpResponse res)-
The entry point to process the response. Applies the Response Vlocity DataRaptor Bundle or Response Items Vlocity DataRaptor Bundle if they're specified. Otherwise, calls
processResponse(String url, String path, HttpResponse res) -
Override this method if custom response processing is required.
-
-
void processResponse(String url, String path, HttpResponse res)-
This method executes if neither Response Vlocity DataRaptor Bundle nor Response Items Vlocity DataRaptor Bundle are specified.
-
Override the method if custom response processing is required.
-
-
Spring '22 release and more recent:
void persistOrchestrationItemLogs(List<vlocity_cmt__OrchestrationItem__c> items)-
Sends the callout's request and response data to the requested location. This method reads the OrchestrationItemLog custom setting and acts accordingly. For information about configuring the custom setting, see OM Standard: Configure Request and Response Storage in Custom Settings.
-
Override the method to send request and response data to a location of your choice. (First, set the OrchestrationItemLog custom setting to Off.)
For example, if you want to send the data to a debug log, you can use something like the following code:
global virtual class CustomIntegrationAdapter extends vlocity_cmt.XOMEnhancedSystemInterface{ public override void persistOrchestrationItemLogs(List<vlocity_cmt__OrchestrationItem__c> items) { for (vlocity_cmt__OrchestrationItem__c item : items){ System.debug('REQUEST IS: '+item.vlocity_cmt__Request__c); System.debug('RESPONSE IS: '+item.vlocity_cmt__Response__c); } } }
-