Components and parameters in the Service Definition Framework

The Service Definition Framework uses the following components and parameters for the integration of HCL Commerce and Sterling Order Management.

SOAP servlet

This component receives requests from HCL Commerce and invokes the appropriate service, based on its definition in the SDF. This entry point for any provided services accepts serviceName and extensionClass as arguments. For example, the following flow shows HCL Commerce calling SCWC_SDF_reserveAvailableInventoryService:


These services are just entry points, and are designed as two-part services. Each calls a "child" subservice so that, if extensive customization is required, it can be done in the subservice. The HCL Commerce -facing part of the service does not need to change, because the subservice performs all the transformation and API invocations involved. In addition, all of these components take the argument "extensionClass," which contains services to use before and after invocation, creating further customization opportunities.
Figure 1. Code example of the beforeServiceCall and afterServiceCall


public interface SCWCIntegrationServiceAPICallback {

	public void beforeServiceCall(YFSEnvironment env, String serviceName, Document input);
	public void afterServiceCall(YFSEnvironment env, String serviceName, Document output);	
	
}

ValueMapXSLT Translator

This component translates requests and responses between Sterling Order Management and HCL Commerce. It converts HCL Commerce message formats to Sterling API XML format and performs reverse (XSLT) value map conversion. The file ValueMaps.xml contains value mapping for specific configuration attributes that may not have same value in both systems, such as StoreId to Enterprise Code and UOM C62 to EACH.
The ValueMapXSLTranslator takes the following parameters:
xslFileName
This property defines the location of the XSL file that is used for the message format conversion and value mapping.
valueMapFileName
This property defines the location of the ValueMaps.xml, which contains the mapping of values between Sterling Order Management and HCL Commerce attributes.
extensionClass
This property is used to extend the behavior of a service.


You can use extensionClass to perform custom logic before or after the input XML conversion.
public interface SCWCXSLTCallback {
	
	public Document beforeXSLTCall(YFSEnvironment env, Document input);
	public Document afterXSLTCall(YFSEnvironment env, Document output);
	
}

API node

This component calls the Sterling Order Management APIs. In the following examples, the HCL Commerce storefront calls the reserveAvailableInventory API using the SCWC_SDF_reserveAvailableInventoryService:


Save Context and RetrieveContextAndAddToResponse

This component works in conjunction with the ValueMapXSLTranslator, mapping certain information in the XSL to a context element. It analyzes the request message and stores the correlating object to the Sterling Order Management context for later use. For example, manual adjustments in Sterling Order Management have no correlation and are not persisted in HCL Commerce. If Sterling Order Management calls getOrderPrice in HCL Commerce to reprice an order that contains a manual adjustment, the adjustment is first "saved" in Sterling Order Management and then added back to the order whenHCL Commerce returns a response.

This component has the following parameters:

SaveContext
Removes correlation data (context element) from a request and saves it before making a service call.
RetrieveContextAndAddToResponse
Returns correlation data to the response.
ValueMapXSLTranslator
XSL file contains mapping of context element to XML output to add information back to the message.
The following example shows the flow for an order that is created by Sterling Call Center that is priced by the HCL Commerce storefront by using the SCWC_SDF_getOrderPriceService. Sterling attributes are persisted with Save Context and RetrieveContextAndAddToResponse.


Invoke HCL Commerce web service

This component is used for synchronous requests from Sterling Order Management to HCL Commerce. It creates a SOAP message and accepts arguments such as HCL Commerce URL and user name. The following example shows the flow for an order created by Sterling Call Center that is priced by the HCL Commerce storefront using the SCWC_SDF_getOrderPriceService.