< Previous | Next >Define a new parameter in request messages
We can add new
value pointsparameter into the existing requested messages from Sterling Order Management. The parameter is then transformed by the Service Definition Framework. The parameter is to be sent to the WebSphere Commerce GetEntitledPrice service to get the calculated price.
Task info
By default, Sterling Order Management and WebSphere Commerce do not support to calculate the entitled price for gift card by itsvalue points. Instead, it is up to the merchant. A merchant sells the gift cards online. The price for the gift card is not only related to the quantity of the gift card, but also related to thevalue pointsof the card. For example:
- The unit base offer price for one
value pointis $1.- If you buy one gift card with 50
value points, the base offer price is $50. After applying some price rules, the contract price is $45.- If the base offer price for 100
value pointsis $100, after applying price rules, the contract price is $80.The unit base price for one
value pointcan be stored, and then the total base offer price can be calculated by multiplying the base price by thevalue pointspurchased by the shopper. In the integrated environment between Sterling Order Management and WebSphere Commerce, the default price calculation flow for a product item is:
- In IBM Sterling Call Center, the product item is open, and Sterling Order Management sends an initial a request to WebSphere Commerce through Service Definition Framework. The message is similar to:
<body xsi:type="ex:getItemPriceRequestMsg"> <input:ItemPrice Currency="USD" EnterpriseCode="MadisonsBase"> <LineItems> <LineItem ItemID="FULO-0101" LineID="1" Quantity="1" UnitOfMeasure="EACH"/> </LineItems> </input:ItemPrice> </body>
- The Service Definition Framework transforms the request message from Sterling Order Management to the format that is understood by WebSphere Commerce, for example:
<_prc:GetEntitledPrice releaseID="9.0" versionID="7.0.0.0" xmlns:_prc="http://www.ibm.com/smlns/prod/commerce/9/price" xmlns:_wcf-"http://www.ibm.com/smlns/prod/commerce/9/foundation" xmlns:oa="http://www.openapplications/org/oagis/9" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance"> <oa:CreationDateTime>2012-03- 07T08:54:27.109Z</oa:CreationDateTime> <oa:BODID>24e42da0-6833-11e1-a38a-82b64f57220b</oa:BODID> <_wcf:BusinessContext> <_wcf:ContextData name="storeID">10001</_wcf:ContextData> </_wcf:BusinessContext> </oa:ApplicationArea> <_prc:DataArea> <oa:Get> <oa:Expression expressionLanguage="_wcf:XPath">{_wcf.ap=IBM_Store_EntitledPrice_All }/EntitledPrice[CatalogEntryIdentifier[ExternalIdentifier[PartNumber='FULO-0101']] and UnitPrice[Price[@currency='USD'] and (Quantity='1.0' and Quantity[@uom='c62'])])]</oa:Expression> </oa:Get> </_prc:DataArea> <_prc:GetEntitledPrice>
- The WebSphere Commerce GetEntitledPrice service transfers the request to price engine. The calculated price returns to the Service Definition Framework.
- The Service Definition Framework transforms the response message to the format that can be understood by Sterling Order Management.
- The Sterling Call Center shows the calculated price on the UI.
The response message format does not need to be changed according to the user story. Compared with the supplied definitions and their response, the price value is different. The price value recalculates the entitled price with the
value pointsparameter.To add the
value pointsparameter into the request message:
- In the request message from Sterling Order Management, add the attribute for
value points, and also insert a node for it, if desired. This is an example:<ItemPrice Currency="USD" EnterpriseCode="MadisonsBase" IsQuantityTierRequested="N" OrganizationCode="MadisonsBase"> <LineItems> <LineItem ItemID="FULO-0101" LineID="1" Quantity="1" UnitOfMeasure="EACH"/> <Extn ValuePoints="500" /> </LineItems> <ItemPrice>
- For the request message to WebSphere Commerce, the
ValuePointsparameter is transformed to VP.Note:
ValuePointsis transformed to VP for conciseness in the XPath. An example of the request message:<_prc:DataArea> <oa:Get> <oa:Expression expressionLanguage="_wcf:XPath">{_wcf.ap=IBM_Store_EntitledPrice_All }/EntitledPrice[ (CatalogEntryIdentifier[ExternalIdentifier{PartNumbe r='FULO-0101']] and UnitPrice[Price[@currency='USD'] and (Quanitity='1.0' and Quantity[@uom='C62'])] and VP='40')}</oa:Expression> </oa:Get> </_prc:DataArea>
All parameters are now defined.