This concept is valid for ICM version 7.10.31 and higher.
cXML Order Injection describes the receiving and handling of a cXML order request, generally sent from a procurement system. After receiving a cXML file, it is parsed, a basket is created with certain values from the cXML file, and an order is created.
This feature is very flexible and will most likely be implemented differently in every project. Therefore, one of the main goals for this implementation was the exchangeability and extensibility of the provided functionality. To achieve this, the handler chain framework has been chosen. This allows projects to easily extend, replace, or remove standard functionality.
Before the handler chain is being executed, ICM receives the cXML via a pipeline call and tries to determine the version of the cXML file evaluating the cXML DOCTYPE tag. If the version cannot be determined, the registered default handler chain will be used, in standard case the CXMLOrderInjectionChainV2. The handler chain manages everything else, like unmarshalling the provided cXML, checking user credentials, creating a basket, mapping different values to the basket, and finally creating the order. In any case, a response will be sent, either including a success message or some information about any problems that occurred, based on the cXML Standard.
There are two main chains implemented in the standard implementation and several handlers. Some of the handlers are version-independent, and some work with version-specific classes. This can be differentiated by the package name. Version-independent handlers can easily be reused in a different chain for a new version.
The first is PreCXMLOrderInjectionChainV2. It handles all kinds of preparation to place the order later. Currently (7.10.31) implemented handlers are:
|Name of Handler||Description|
|ParseCXMLOrderInjectionHandler||Handler that parses the input stream to an object.||no|
Handler that checks if the user data sent in the cXML Header are valid.
|MapBasketCXMLOrderInjectionHandler||Handler that maps the cXML OrderRequest to a basket.||yes|
|MapLineItemsCXMLOrderInjectionHandler||Handler that adds items from a cXML order request to a basket.||no|
Handler that adds a shipping method to the basket from cXML.
|MapOrderAddressesCXMLOrderInjectionHandler||Handler that adds an invoice address and shipping address for the whole order if specified in the cXML.||no|
Handler that sets the configured payment method at the basket.
|PrepareBasketForOrderCreationCXMLOrderInjectionHandler||Handler that prepares a basket for the order creation by validating and calculating.||yes|
The second chain CreateOrderCXMLOrderInjectionChainV2 creates the actual order and has only one handler:
|Name of Handler||Description||Version-independent|
Handler that creates an order from a basket, which was created from a cXML order request.
In a development environment the actual loaded handlers can be checked via a pipeline call to InspectHandlerChains-Start, like https://<yourServer>/INTERSHOP/web/WFS/inSPIRED-inTRONICS_Business-Site/en_US/-/USD/InspectHandlerChains-Start.
If there is a failure in any of the handlers, the chain will be rolled back. In standard implementation that means the reverseInvoke() from MapBasketCXMLOrderInjectionHandler will be called, which moves the basket into the basket history.
The cXML order injection feature released with 7.10.31 is based and tested on cXML Version 1.2.049. In ICM, the implemented cXML feature is referred to as V2.
Other minor cXML versions will most likely work with V2 as well but that has not been tested.
If another feature version is needed, this can be done by implementing a new handler chain for the according version and registering it via Guice. Please refer to Cookbook - cXML Order Injection | Recipe: How To Support Another Version of cXML.
https://punchoutcommerce.com/tools/cxml-order-tester offers a testing tool for your environment.
If your environment is only available internally, you can follow Cookbook - cXML Order Injection | Recipe: How To Test My System.
This section describes how certain values can be configured. Since order injection doesn't deal with localized text, this description relates only to the unit mapping configuration.
This concept is valid from ICM version 184.108.40.206.
In the first implementation of cXML Punchout and order injection (ICM 7.10.31), the configuration of data like unit mapping and locale configuration were limited.
The newly introduced UserPreference table allows now to store user specific cXML configuration data, like the unit mapping and locale.
The unit mapping converts procurement system units like box or piece etc. to units used in ICM and vice versa.
For both a global configuration can be stored in properties.
The UserPreference table data allows to customize those values per user aka cXMLUser. (see references documents for details)
cXML - is a standard for Punchout similar to OCI. Besides the Punchout to an external B2B store, it also supports an order injection with basket data.
Overview - Punchout - is the starting page for all ISH documents related to Punchout with cXML and OCI
This provider is used to supply the configurations for the global or user specific locale and the unit mapping. It is used for both, the cXML punchout basket and the cXML order injection.
The provider currently has two methods:
Map<String, String> getUnitMappings(UserBO userBO); LocaleInformation getPunchoutLocale(UserBO userBO);
The locale configuration is used for localized product texts when transferring the punchout basket.
It is possible to create a property with key "intershop.cxml.punchout.locale" to define a "global" configuration.
It is also possible to create a preference in table UserPreferences with name "punchout.locale" and group "cxml" to define a user specific configuration.
The hierarchy or priority for the locale is as follows:
The user specific preference stored with the given user.
The 'global' configuration stored in a property, read via ConfigurationMgr.
The locale stored for the current application.
The system wide lead locale.
The unit mapping is used for both, punchout and order injection.
It converts units available in the calling Procurement system to units available in ICM and vice versa.
It is possible to create a property with key prefix "intershop.cxml.unitmapping" to define "global" mapping configurations.
example: intershop.cxml.unitmapping.EA=pcs or intershop.cxml.unitmapping.BX=Box etc.
It is also possible to create a preference in table UserPreferences with name "unitmapping" and group "cxml" to define a user specific mapping configuration.
Here the configuration data is expected to be stored in one line.
The key and values are separated by a ':', the different groups(key-value-pairs) are separated by a '\t' tabulator character.
example stringValue: EACH;pcs BOX;box DOZ;DOZEN
Any configuration which doesn't fit the pattern, will be printed out as a warn log message and ignored for processing!
The unit mapping actually used in the REST calls, can come from user specific preference configurations, from a global property configurations and a combination of both.
The hierarchy or priority for the unit-mapping is as follows:
The user specific preference stored with the given user.
it overwrites/replaces any aleady existing global values and adds not existing user configurations
The 'global' configuration stored in properties, read via ConfigurationMgr.
value used for mapping
It is possible to use a global configuration and just replace the few specific to the user.
To use only user specific configuration, by not creating a global configuration with properties.
Or use only global configuration with properties, by not having an user specific data.
The information provided in the Knowledge Base may not be applicable to all systems and situations. Intershop Communications will not be liable to any party for any direct or indirect damages resulting from the use of the Customer Support section of the Intershop Corporate Web site, including, without limitation, any lost profits, business interruption, loss of programs or other data on your information handling system.