Tattvamasi Group
Monday, September 2, 2019
Different Areas in Data Science
Predictive analytics:
NoSQL databases:
Search and knowledge discovery:
Stream analytics:
In-memory data fabric:
Distributed file stores:
Data virtualization:
Data integration:
Data preparation:
Data quality:
NoSQL databases:
Search and knowledge discovery:
Stream analytics:
In-memory data fabric:
Distributed file stores:
Data virtualization:
Data integration:
Data preparation:
Data quality:
Predictive Analysis in Bigdata
Predictive Analysis is used to make predictions about unknown future events. Predictive analytics uses data mining, statistics, modeling, machine learning, and artificial intelligence to analyze current data to make predictions about future.Predictive analytics is the preparation of extracting information from existing data sets. This is to determine patterns and predict future outcomes and trends. Predictive analytics does not tell you what will happen in the future. It forecasts what might happen in the future with an acceptable level of reliability, and includes what-if scenarios and risk assessment.
Predictive models and analysis are typically used to forecast future probabilities. Applied to business, predictive models are used to analyze current data and historical facts in order to better understand customers, products and partners and to identify potential risks and opportunities for a company.
Predictive models and analysis are typically used to forecast future probabilities. Applied to business, predictive models are used to analyze current data and historical facts in order to better understand customers, products and partners and to identify potential risks and opportunities for a company.
What is Big Data
Big Data is the collection of large and complex data sets. Storage , Analysis and capture of this data becomes challenging.
Characteristics of Big Data
Volume : This refers to the huge size of the data.
Variety: It refers to the type and nature of data.
Velocity:It is the speed at which data is generated.
Variability: Variability refers to the inconsistency of huge data set.This inconsistency may create problems to handle huge data sets.
Veracity:It refers to the messiness or trustworthiness of the data.The quality of captured data can vary greatly, affecting the accurate analysis.
Characteristics of Big Data
Volume : This refers to the huge size of the data.
Variety: It refers to the type and nature of data.
Velocity:It is the speed at which data is generated.
Variability: Variability refers to the inconsistency of huge data set.This inconsistency may create problems to handle huge data sets.
Veracity:It refers to the messiness or trustworthiness of the data.The quality of captured data can vary greatly, affecting the accurate analysis.
Marketing Subsystems in WCS
The Marketing subsystem in WCS provides numerous marketing concepts to your web site, designed to increase brand awareness, and to attract and retain customers. Marketing subsystem provide functionality to create marketing campaigns, including customer segments and advertising; and e-mail activities.
Order Management Subsystem in WCS
1.Orders
A typical order includes one or more products, billing and shipping addresses, payment details, and the total cost including shipping charges and taxes.
2.Order Management
The Order Management subsystem is a component of the WebSphere Commerce Server that provides shopping carts, order capture, order fulfillment, inventory, and payment function support.
Order Management is broadly divided into
1)Order Capture
2)Order processing
3)Inventory Processing
4)Payment Processing
2.1. Order Capture
Order capture provides functionality such as sales quotes and shopping carts and order submission. There are a number of ways to create shopcarts and submit orders, as described in the order mechanisms section.
2.2.Order processing
Order processing is responsible for the overall coordination of inventory allocation, payment processing, releasing the order to fulfillment and tracking order status.
2.3.Inventory processing
WebSphere Commerce supports four inventory systems: Available to promise (ATP), and non-ATP, No inventory, and external inventory. The interface to inventory is encapsulated by a single inventory task command, which in turn invokes either ATP or non-ATP task commands.
2.4.Payment processing
WebSphere Commerce Payments supports the use of payment plug-ins for offline or online payment processing.In addition, the subsystem deals with order management capabilities like
1)quick order or buy
2)scheduled orders
3)multiple pending orders
4)reorders
5)order splits or backorders
6)future orders
3.Inventory Allocation
WebSphere Commerce supports five inventory systems: Available to promise (ATP), non-ATP, no inventory, external inventory, and DOM inventory. The interface to inventory is encapsulated by a single inventory task command, which in turn invokes the appropriate task commands.
The five inventory systems apply to the following situations:
3.1.ATP inventory
Using the ATP inventory model, you can allocate stock from existing inventory or backorder from expected inventory. You can also obtain an estimated availability time for each order item after it is added into the shopping cart. The ATP also supports allocating stocks for future order processing.
3.2.Non-ATP inventory
The non-ATP inventory model supports inventory operations that are only based on existing on-hand inventory.
3.3.No inventory
The no inventory model assumes that all products have infinite quantities. When the products in a store are virtual products, digital downloadable products, or electronic assets, such as downloadable images or music, you can use this model.
The no inventory model has three typical characteristics that differentiate it from the other inventory models:
1.All products have unlimited available quantities. Any check of inventory always returns a positive result.
2.Since all products have infinite available quantities, all order items are successfully allocated after an 'allocate inventory' operation. Specifically, the INVENTORYSTATUS column of the ORDERITEMS table is always set to 'ALLC'.
3.The No inventory system does not support RTF (Release to Fulfillment), Pick batch, and Ship Confirmation. Order management functions can be supported by custom integration with an existing order management system.
3.4.External Inventory
External inventory is used to integrate WebSphere Commerce with external inventory systems. External inventory is the legacy inventory implementation model where WebSphere Commerce directly consumes the inventory information from an external system.
3.5.DOM inventory system
DOM inventory is used for WebSphere Commerce distributed order management integration. For the DOM inventory system,WebSphere Commerce calls outbound services to allocate inventory externally. Integration with Sterling Order Management is based on the DOM inventory model. The DOM inventory system differs from the external inventory model in the following ways:
1)The DOM inventory model supports the local inventory cache in WebSphere Commerce. The external inventory model does not support the use of the local inventory cache.
2)The DOM inventory model uses the new logical schema and outbound service interfaces. The external inventory model uses the legacy inventory outbound service interfaces.
4.Calculation codes for orders
Calculation codes represent ways of determining monetary amounts associated with OrderItems. The CalculationCode object and its associated CalculationMethod objects define how to calculate amounts such as price adjustments (coupons and discounts), shipping charges, and taxes.
The OrderCalculate and OrderPrepare commands determine which kinds of calculations should be performed by inspecting the STENCALUSG table. OrderCalculate will accept the `calculationUsageId' parameter, which will determine the kinds of charges calculated in OrderCalculate. (You can define additional kinds of calculations to be performed, and provide or extend the business logic associated with each kind of calculation.)
The default CalculationMethod objects determine which CalculationCode objects apply to the items in an Order by searching for attachment relationships in the CATENCALCD, CATGPCALCD, ORDCALCD, and ORDICALCD tables. They calculate their amounts and, in addition to quantitative attributes of the product such as weight, quantity, and price, they take into account the following attributes:
1)Calculation code
2)Member group membership
3)calculation scales
4)Start and end dates
5)Sequence in which calculations should be performed
5.Fulfillment centers
Stores use fulfillment centers as both inventory warehouses and shipping and receiving centers. One store can have one or many fulfillment centers.
WebSphere Commerce can designate a fulfillment center as being `Drop Ship'. This involves requesting a fulfiller to ship the items directly to the customer rather than from the seller's own fulfillment center. A fulfillment center requests a pick batch (a group of releases that are managed as a unit) for a specified fulfillment center and store. The default behavior is to group up to 25 releases in the pick batch. But even when fewer than 25 releases are present in the database, a pick batch will be created for those releases.
From a WebSphere Commerce Server perspective, a FulfillmentCenter object is separate from the Store object. It manages product inventory and shipping. To ship an order, the fulfillment center relies on a ShippingMode object that is specified by the customer. The ShippingMode object indicates the shipping carrier and method of shipping for fulfilling the customer's order.
In a fulfillment center, the ShippingArrangement object indicates that a Store object has arranged with a FulfillmentCenter object to ship products using a certain ShippingMode, within a certain time range. For example: a store has an arrangement with its fulfillment center to ship an order within 24 hours if the customer selects an express shipping option.
6.Pricing and offers
Offers present different prices for the same product or SKU to different customers. In WebSphere Commerce, an offer is also known as a trading position. An offer represents the price of a catalog entry and criteria that the customer must satisfy in order to pay that price.
The Offer object has a quantity range attribute that specifies the minimum or maximum quantity that can be sold in an order under the available offer. The Offer object also indicates a date range and the member groups of the trading position container (price list).
An Offer object is part of a TradingPositionContainer (PriceList), which is owned by a member. A TradingPositionContainer contains TradingPositions. It can be made available to all customers, or only to customers in certain groups by using the trading agreements or contracts. There are three kinds of price lists:
S:Standard price list which contains the base prices for the products in the store catalog.
C:Custom price list which specifies the list of products and their customized prices.
E:Custom price list which specifies the list of products and their customized prices, but improves performance during maintenance.
7. WCS Order flow Process
7.1.Add To Cart
User is browsing the site as anonymous, guest or authenticated user and adds an item from browse pages to cart
You can call the OOB non AJAX version "/OrderChangeServiceItemAdd" which is mapped as follows in struts-config
<action parameter="com.ibm.commerce.orderitems.commands.OrderItemAddCmd" path="/OrderChangeServiceItemAdd" type="com.ibm.commerce.struts.BaseAction">
</action>
If you want to use AJAX version use "/AjaxOrderChangeServiceItemAdd" command
<action parameter="order.addOrderItem" path="/AjaxOrderChangeServiceItemAdd" type="com.ibm.commerce.struts.AjaxComponentServiceAction">
</action>
Refer following link for various AJAX actions supported by this Fascade
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.madisons-starterstore.doc/refs/rsmmadisonorderservices.htm
Both AJAX and non AJAX finally make use of following implementation This uses following OOB controller command
com.ibm.commerce.orderitems.commands.OrderItemAddCmdImpl
- Extends com.ibm.commerce.orderitems.commands.OrderItemBaseCmdImpl
Any customization would require extension of OOB OrderItemAddCmdImpl
User clicks on add to cart it calls the OrderFacadeClient addOrderItem() method From there OrderItemAddCmd will be invoked. OrderItemAddCmd will in turn call the OrderCalculate and from there OrderItemDisplayCmd is invoked. OrderItemDisplayCmd will call the OrderItemDisplayView which will display the shopping cart with the newly added item.
7.2.View Cart
User clicks on View Cart Page
At this step you want to display guest the cart content with list of order items with pending order status
You can use following OOB Struts action url "/OrderItemDisplay"
<action
parameter="com.ibm.commerce.orderitems.commands.OrderItemDisplayCmd"
path="/OrderItemDisplay" type="com.ibm.commerce.struts.BaseAction">
<set-property property="https" value="0:1"/>
<set-property property="authenticate" value="0:0"/>
</action>
Review following link for more details on optional and mandatory input parameters for this URL
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/refs/rosorderitemdisplay.htm
This action internally makes use of following OOB controller command
com.ibm.commerce.orderitems.commands.OrderItemDisplayCmdImpl
Control the various calculations that needs to be performed before you display the Cart Page
E.g by passing following in URL calculationUsageId=-1&calculationUsageId=-2&calculationUsageId=-7 you are triggering calculation of Tax, discount, Shipping
Any customization would require extension of OOB OrderItemDisplayCmdImpl
7.3.Update Cart Item
User changes quantity and clicks on update button it will call the OrderFacadeClient updateOrderItem() method.From there OrderItemUpdateCmd will be invoked. OrderItemUpdateCmd will in turn call the OrderCalculate and then OrderItemDisplayCmd is invoked. OrderItemDisplayCmd will call the OrderItemDisplayView which will display the modified shopping cart.
7.4.Delete Cart Item
User clicks on delete control will go to OrderFacadeClient updateOrderItem() method .From there OrderItemUpdateCmd will be invoked. OrderItemUpdateCmd will inturn call the OrderCalculate and from there OrderItemDisplayCmd is invoked. The OrderItemDisplayCmd will call the OrderItemDisplayView which will display the modified shopping cart.
7.5.Checkout
User clicks on checkout and is navigated to shipping page
<action
parameter="com.ibm.commerce.orderitems.commands.OrderItemUpdateCmd"
path="/OrderItemUpdate" type="com.ibm.commerce.struts.BaseAction">
<set-property property="https" value="0:1"/>
<set-property property="authenticate" value="0:0"/>
</action>
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/refs/rosorderitemupdate.htm
This action used following OOB command com.ibm.commerce.orderitems.commands.OrderItemUpdateCmdImpl
User clicks on checkout it will call OrderFacadeClient updateOrderItem() method.From there OrderItemUpdateCmd will be invoked. OrderItemUpdateCmd will in turn call the OrderCalculate and then forward to the OrderShippingBillingView.
7.6.Enter Shipping\Billing Address
User enters shipping address and submit then control will go to OrderFacadeClient updateOrderShippingInfo() method. From there OrderItemUpdate command is called.OrderItemUpdate will call the OrderCalculate and will forward to OrderShippingBillingView.
7.7.Enter Payment Information
User navigates to payments page
This flow typically includes adding single/multiple payment information to an order, once the payment information is submitted
we can use following command for processing before forwarding user to review order screen
The OOB /OrderProcess should be used for this purpose,
it is implemented by following OOB command com.ibm.commerce.order.commands.OrderPrepareCmdImpl
Pass appropriate payment parameters to add the payment information entered to an Order.
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/refs/rosorderprocess.
User Enters Payment information and press confirm order ,the client calls the order facade client method prepareOrder().This is followed by OrderFacdeClient addPaymentInstruction() method that invokes PIAddCmd and then forward to OrderSummaryView.If user updates the payment information OrderFacdeClient updatePaymentInstruction() method is called which inturn will call the PIEditCmd and will forward to OrderSummaryView. If user remove the payment information orderFacdeClient removePaymentInstruction() method is called which in turn will call the PIRemoveCmd and will forward to OrderSummaryView.
7.8.Place\Submit Order
User navigates to review order page and submits order
The OOB /OrderProcess should be used for final Order submission, as mentioned in previous step this URL
implements OOB com.ibm.commerce.order.commands.OrderProcessCmdImpl command.
Order Submission and post processing
Once an Order is submitted OrderProcessCmdImpl Calls RaiseOrderEventCmd to raise ORDER_SUBMISSION_EVENT
com.ibm.commerce.order.event.RaiseOrderSubmitEventCmd
any customization to this command would require extension of
com.ibm.commerce.order.event.RaiseOrderSubmitEventCmdImpl command which is the default implementation.
com.ibm.commerce.order.event.ProcessOrderSubmitEventCmdImpl which is default implementation of OOB
com.ibm.commerce.order.event.ProcessOrderSubmitEventCmd listens to ORDER_SUBMISSION_EVENT and takes care
of transferring the order to the external system.
This is the appropriate command for customization If you need any customization in Order XML which is posted to external system
User clicks on place or submit order OrderFacadeClient processOrder() method will be called. This in turn will call the Order Process command and will forward to the OrderShippingBillingConfirmationView.
8.Complete Order Flow commands are listed below
8.1.OrderItemAddCmdImpl
public class OrderItemAddCmdImpl
extends OrderItemBaseCmdImpl
implements OrderItemAddCmd
Adds items or products to the list of items that are to be shipped.
This command accepts enumeration type of parameters. That is, it accepts parameterName_i=parameterValue.
For example, to add three catalog entries with id 15, 16, and 17 to the OrderItems, you can pass catEntryId_1=15&catEntryId_2=16&catEntryId_3=17 to the command. If you call the individual set method to pass the above parameters, you need to create a hashtable and add the following to the hashtable:
hashtable.put(new Integer(1), new String("15"));
hashtable.put(new Integer(2), new String("16"));
hashtable.put(new Integer(3), new String("17"));
then passed the hashtable to the method setCatEntryId(Hashtable).
This command adds items or products to the shopping cart. OrderItemAddCmdImpl calls the below commands in this sequence.
1)ResolveSkuCmdImpl
2)OrderCreateCmd
3)ResolveOrderItemPriceCmd
4)UpdateShippingAddressCmd
5)ValidateTradingPaymentCmd
6)DoInventoryActionCmd(CheckInventory)
7)UpdateShipInfoCmdImpl
8)RaiseOrderEventCmdImpl
9)OrderCalculateCmd
10)ExtendedOrderItemProcessCmd
1)ResolveSkuCmdImpl
This command finds the type of catalog entry. If it is a package then PackageResolveSkuCmd is called. If it is a product then this command determines the attributes required to resolve the product to an orderable item. If attributes are missing then ErrorMissingAttributeErrorCmd or ErrorProductAttributeErrorCmd is called.
2)OrderCreateCmd
This order command is used to create an order container with no line items.
3)ResolveOrderItemPriceCmd
This command is used to resolve price for a group of order items from one order.This command calculates the best price for the input OrderItems. It calls GetContractUnitPriceCmd or GetContractSpecialPriceCmd task command to calculate the price. If GetContractUnitPriceCmd/GetContractSpecialPriceCmd is not available, it calls GetBaseUnitPriceCmd/GetBaseSpecialPriceCmd. If input trading agreements and/or offers are specified, they will be used providing they are valid. Otherwise, eligible trading agreements will be obtained.
4)UpdateShippingAddressCmd
This Order task command is used to update the shipping address for the passed order items
5)ValidateTradingPaymentCmd
ValidateTradingPaymentCmd is called to validate that the payment method is compatible with the trading agreement
6)DoInventoryActionCmd(CheckInventory)
If doInventory = Y, call DoInventoryActionCmd to update the fulfillment centers and check for available inventory
7)UpdateShipInfoCmdImpl
Call UpdateShipInfoCmd to update the shipping instructions, shipping account number and shipping charge type
8)RaiseOrderEventCmdImpl
Call RaiseOrderEventCmd to raise ORDERITEM_CREATION_EVENT or ORDERITEM_UPDATE_EVENT
9)OrderCalculateCmd
If the flag calculateOrder is set then Call OrderCalculateCmd to do calculations that are based on the calUsageIds passed in
10)ExtendedOrderItemProcessCmd
Call ExtendOrderItemProcessCmd to execute any customization logic
8.2.OrderItemUpdateCmdImpl
public class OrderItemUpdateCmdImpl
extends OrderItemBaseCmdImpl
implements OrderItemUpdateCmd
Add products or items to the order list or update the products and items in the existing order list.
This command can do all that OrderItemAdd command can do. In addition, it can also update products and items in the existing order list.
This command accepts enumeration type of parameters. That is, it accepts parameterName_i=parameterValue.
For example, to add three catalog entries with id 15, 16, and 17 to the OrderItems, you can pass catEntryId_1=15&catEntryId_2=16&catEntryId_3=17 to the command. If you call the individual set method to pass the above parameters, you need to create a hashtable and add the following to the hashtable:
hashtable.put(new Integer(1), new String("15"));
hashtable.put(new Integer(2), new String("16"));
hashtable.put(new Integer(3), new String("17"));
then passed the hashtable to the method setCatEntryId(Hashtable).
The command will execute each enumeration group one by one. But the order of execution is not guaranteed. So if you pass two orderItemId with the same number, the result is unpredictable.
When updating the order item with quantity = 0, this order item will be deleted. If you delete the same order item twice in one transaction, it will throw a remote exception.
OrderItemUpdateCmdImpl command updates order items in an existing Order.OrderItemUpdateCmdImpl calls the following commands in sequence
1)DoInventoryActionCmd(Reserve Inventory)
2)AddOrderItemComponentsCmd
3)ResolveOrderItemPriceCmd
4)UpdateShippingAddressCmd
5)ValidateTradingPaymentCmd
6)DoInventoryActionCmd(Check Inventory)
7)updateShipInfoCmdImpl
8)RaiseOrderEventCmdImpl
9)OrderCalculateCmd
10)ExtendedOrderItemProcessCmd
1)DoInventoryActionCmd(Action : Reserve Inventory)
In ATP inventory systems it calls the command ReserveInventoryCmd. In Non-ATP inventory systems calls the UpdateInventoryCmd.
ReserveInventoryCmd
This command get the quantity available for the requested item, store, and fulfillment center.This command check to make sure that the quantity available is greater or equal to the quantity requested.If it is successful,obtain the ITEMFFMCTR row and increment the itemffmctr.qtyreserved by the requested quantity,then insert a new row into the INVRESERVE table.
UpdateInventoryCmd
UpdateInventory let you update inventory for items. There are two ways to update inventory.Set one or list of order items by calling setOrderItem method.Set one catalog entry by calling setCatEntryId, setQuantity and setStoreId methods. Method setQuantityMeasure is optional.
2)AddOrderItemComponentsCmd
This command creates the components that are associated with a composite order item. It derives the component list in one of two ways
1. By making use of a list of CatalogEntries that are passed in
2. Get the list of components by finding all of the unassigned components through the given configuration id.
3)ResolveOrderItemPriceCmd
This command is called to calculate the best price and update order total.
4)UpdateShippingAddressCmd
This Order task command is used to update the shipping address for the order items passed in the request.
5)ValidateTradingPaymentCmd
ValidateTradingPaymentCmd is called to validate that the payment method is compatible with the trading agreement.
6)DoInventoryActionCmd(Check Inventory)
Check Inventory allows us to check inventory for items. There are two ways to check inventory.
1) Set one or list of order items by calling setOrderItem method.
2) Set one catalog entry by calling setCatEntryId, setQuantity and setStoreId methods. Method setQuantityMeasure is optional.
7)updateShipInfoCmdImpl
Call UpdateShipInfoCmd to update the shipping instructions, shipping account number and shipping charge type.
8)RaiseOrderEventCmdImpl
Call RaiseOrderEventCmd to raise ORDERITEM_CREATION_EVENT or ORDERITEM_UPDATE_EVENT.
9)OrderCalculateCmd
If the flag calculateOrder is set Call OrderCalculateCmd to do calculations that are based on the calUsageIds passed in.
10)ExtendedOrderItemProcessCmd
Call ExtendOrderItemProcessCmd to execute any customization logic.
8.3.OrderItemDeleteCmdImpl
public class OrderItemDeleteCmdImpl
extends OrderBaseCmdImpl
implements OrderItemDeleteCmd
This is the default implementation of the OrderItemDeleteCmd controller command.
This command delete order items based on orderItemId or catEntryId specified.OrderItemDeleteCmdImpl calls below commands in sequence.
1)DoInventoryActionCmd(ReserveInventory)
2)PrepareShipInfoCmd
3)ReolveOrderItemPriceCmd
4)OrderCalculateCmd
1)DoInventoryActionCmd(Action : Reserve Inventory)
In ATP inventory systems it calls the command reserveInventoryCmd. In Non-ATP inventory systems calls the updateInventoryCmd.
ReserveInventoryCmd
Get the quantity available for the requested item, store, and fulfillment center.Check to make sure that the quantity available is greater or equal to the quantity requested.If the above edit is successful,obtain the ITEMFFMCTR row and increment the itemffmctr.qtyreserved by the requested quantity,then insert a new row into the INVRESERVE table.
updateInventoryCmd
UpdateInventory let you update inventory for items. There are two ways to update inventory.Set one or list of order items by calling setOrderItem method.Set one catalog entry by calling setCatEntryId, setQuantity and setStoreId methods. Method setQuantityMeasure is optional.
2)PrepareShipInfoCmd
Perform a verification between the SHIPINFO table and the ORDERITEMS table and check for orphaned SHIPINFO records. Any orphaned records will be removed.
3)ReolveOrderItemPriceCmd
This command is used to resolve price for a group of order items from one order.This command calculates the best price for the input OrderItems.This command calls the GetContractUnitPriceCmd/GetContractSpecialPriceCmd task command to calculate the price.
If GetContractUnitPriceCmd/GetContractSpecialPriceCmd is not available, it calls the GetBaseUnitPriceCmd/GetBaseSpecialPriceCmd. If input trading agreements and/or offers are specified, they will be used providing they are valid. Otherwise, eligible trading agreements will be obtained.
4)OrderCalculateCmd
If the flag calculateOrder is set Call OrderCalculateCmd to do calculations that are based on the calUsageIds passed in.
8.4.OrderPrepareCmd (Controller Command)
public interface OrderPrepareCmd
extends ControllerCommand
This command prepares an order by determining prices, discounts, shipping charges, shipping adjustment, and taxes for an order. If an order reference number is not specified, all current pending orders will be prepared for the current customer at the given store. The default implementation of this command is OrderPrepareCmdImpl. The OrderPrepareCmd URL is mapped to this controller command.
Prepares an order by determining its prices, discounts, shipping charges, and taxes. If an order reference number is not specified, all current pending orders will be prepared for the current customer at the given store. The remerge, merge, check, allocate, backorder and reverse parameters are applicable only if ATP inventory is enabled (STORE Table INVENTORYSYSTEM column value -1).
OrderPrepareCmd calls the following commands in sequence
1.PrepareOrderCmd(Task Command)
2.ValidateShippingAdjustmentCmd
PrepareOrderCmd(Task Command)
PrepareOrderCmd task command prepares an order by determine its prices, discounts, shipping charges, and taxes for an order. This command will also lock the order to indicate that it is ready for submission for the Order Process command. The lock can be reset either by expiry, by changing the Order during update or delete operations or by calling OrderUnlockCmd.The expiry period for a lock is stored in STORE table column QUOTEGOODFOR.
This command removes generated order item based on the prepare flags setting (PREPARE FLAG = 1 which means generated) in ORDERITEMS table. This command will also check if all order items are buyable and throw exceptions if they are not buyable. UpdateShippingAddressCmd is called to find the appropriate shipping address for all the order items and update them for each order item. For a dynamic kit ValidateDynamicKitConfigurationCmd is called to do validation. ResolveOrderItemPriceCmd is called to calculate the best price and update order total. DoInventoryActionCmd is called for inevntoy check and allocation .CalculateOrderCmd is called for calculation of charges.
ValidateShippingAdjustmentCmd
This Order task command is used to find any inconsistencies in the order's shipping adjustments. If new items have been added then the value returned from hasShoppingCartChanged() will be true else it will be false.
8.5.OrderProcessCmd (Controller Command)
public interface OrderProcessCmd
extends ControllerCommand
This Order controller command is used to submit an order. The order must have been locked by OrderPrepare. Once the OrderProcess command begins running, the order cannot be cancelled with OrderCancel.
The default implementation of this command is OrderProcessCmdImpl.
The OrderProcessCmd URL is mapped to this command.
This command submits an order for processing. The order must be locked by the Order Prepare command before calling this command.
OrderProcessCmd calls the following commands in the below sequence
1)PIAddCmd
This controller command is used to create a new payment method to an order.
2)ValidatePaymentMethodCmd
This command checks whether the payment method to be added comply with the Buy Online Pick In Store (BOPIS) rules.
3)ProcessOrderCmd
The ProcessOrderCmd task command makes the ProcessOrder server request.
4)RaiseOrdereventCmd
The RaiseOrderEventCmd task command is used to raise an order related event
ProcessOrderCmd (Task Command)
ProcessOrderCmd makes the ProcessOrder server request.ProcessOrderTaskCmd calls commands in sequence as shown below.
1)PreProcessOrderCmd
If Unified Business Flow is not enabled or is enabled and approval is needed then this command is called.
2)DoInventoryActionCmd(getATPParameter)
Call DoInventoryActionCmd to update inventory.
3)UpdateSependingLimitCmd
Call UpdateSpendingLimitCmd to check the trading agreement spending limit and validate the PO number.
4)PrimePaymentCmd
Call PrimePaymentCmd (EDP command) to guarantee that the customer has funds to pay for the order.
5)RaiseOrderSubmitEventCmd
Call RaiseOrderSubmitEventCmd to raise the order submit event.
6)PersisitOrdersWithMemberGroupIdsForCurrentUserCmd
PersistOrdersWithMemberGroupIdsForCurrentUserCmd (Marketing command) is called If OrdersMgpPersistListener is enabled in order to persist the orders_id with the member group id.
7)ExtOrderProcesCmd
ExtOrderProcessCmd command is called to execute any customization logic during order process flow.
8)TransferOrderCmd
This command confirms successful transfer of an order to an external system. This command is called to generate the outbound Order Create Message.
9)OrderMessagingCmd
This command generates the outbound Order Create Message "Report_NC_PurchaseOrder".
9.Tables Involved with Order Subsystem
9.1.ORDERS
Each row in this table represents an order in a store.
9.2.SUBORDERS
Each row of this table contains subtotals of amounts for all the OrderItems of an Order with the same shipping address.
9.3.ORDADJUST
Each row of this table represents an OrderAdjustment.
9.4.ORDIADJUST
Each row in this table represents an OrderItemAdjustment.
9.5.ORDADJTXEX
Each row of this table indicates that an OrderAdjustment is exempt from taxation of a particular TaxCategory. For example, an "after tax rebate" can be represented as a negative OrderAdjustment that is exempt from taxation of all TaxCategories.
9.6.ORDCALCD
Each row of this table indicates to the CalculationCodeCombineMethod that a CalculationCode is directly attached to all OrderItems in an Order. The order directCalculationCodeAttachment flag in ORDERITEMS.PREPAREFLAGS is 1.
9.7.ORDERITEMS
Each row of this table represents an order item in an order.
9.8.ORDPROMOCD
This table contains promotion codes captured for an order.
9.9.CPENDORDER
Each row of this table indicates that an order is marked as current for a customer in a store, if its status is "P" (Pending).
9.10.ORDPAYINFO
Each row in this table holds a name-value pair representing payment information for a particular Order. Values added to this table are encrypted when the "Instance/PDIEncrypt" configuration flag is "on".
9.11.ORDICALCD
Each row of this table indicates to the CalculationCodeCombineMethod that a CalculationCode is directly attached to an OrderItem. The attachment is not effective unless the directCalculationCodeAttachment flag in ORDERITEMS.PREPAREFLAGS is 1.
9.12.ORDTAX
Each row of this table represents the total of the tax amounts of a particular TaxCategory for all the OrderItems in an Order.
9.13.SUBORDTAX
Each row of this table specifies the tax amount of a particular TaxCategory for all the OrderItems with the same shipping address as the SubOrder.
9.14.ORDITAX
Each row of this table contains a tax amount of a particular TaxCategory, for an OrderItem. By default, WebSphere Commerce does not save any data in this table. However tax amounts are aggregated by TaxCategory in the SUBORDTAX and ORDTAX tables.
9.15.ORCOMMENT
The table stores the comments for an order entered by a customer service representative.
9.16.ORDERHIST
This table is used to save order snapshots in XML format.
9.17.ORDSTAT
This table contains information about the status of an order for an Order Status Update inbound message. Each row in the table contains information about a single order.
9.18.ORDUSERS
Contains information about users that worked with an order.
A typical order includes one or more products, billing and shipping addresses, payment details, and the total cost including shipping charges and taxes.
2.Order Management
The Order Management subsystem is a component of the WebSphere Commerce Server that provides shopping carts, order capture, order fulfillment, inventory, and payment function support.
Order Management is broadly divided into
1)Order Capture
2)Order processing
3)Inventory Processing
4)Payment Processing
2.1. Order Capture
Order capture provides functionality such as sales quotes and shopping carts and order submission. There are a number of ways to create shopcarts and submit orders, as described in the order mechanisms section.
2.2.Order processing
Order processing is responsible for the overall coordination of inventory allocation, payment processing, releasing the order to fulfillment and tracking order status.
2.3.Inventory processing
WebSphere Commerce supports four inventory systems: Available to promise (ATP), and non-ATP, No inventory, and external inventory. The interface to inventory is encapsulated by a single inventory task command, which in turn invokes either ATP or non-ATP task commands.
2.4.Payment processing
WebSphere Commerce Payments supports the use of payment plug-ins for offline or online payment processing.In addition, the subsystem deals with order management capabilities like
1)quick order or buy
2)scheduled orders
3)multiple pending orders
4)reorders
5)order splits or backorders
6)future orders
3.Inventory Allocation
WebSphere Commerce supports five inventory systems: Available to promise (ATP), non-ATP, no inventory, external inventory, and DOM inventory. The interface to inventory is encapsulated by a single inventory task command, which in turn invokes the appropriate task commands.
The five inventory systems apply to the following situations:
3.1.ATP inventory
Using the ATP inventory model, you can allocate stock from existing inventory or backorder from expected inventory. You can also obtain an estimated availability time for each order item after it is added into the shopping cart. The ATP also supports allocating stocks for future order processing.
3.2.Non-ATP inventory
The non-ATP inventory model supports inventory operations that are only based on existing on-hand inventory.
3.3.No inventory
The no inventory model assumes that all products have infinite quantities. When the products in a store are virtual products, digital downloadable products, or electronic assets, such as downloadable images or music, you can use this model.
The no inventory model has three typical characteristics that differentiate it from the other inventory models:
1.All products have unlimited available quantities. Any check of inventory always returns a positive result.
2.Since all products have infinite available quantities, all order items are successfully allocated after an 'allocate inventory' operation. Specifically, the INVENTORYSTATUS column of the ORDERITEMS table is always set to 'ALLC'.
3.The No inventory system does not support RTF (Release to Fulfillment), Pick batch, and Ship Confirmation. Order management functions can be supported by custom integration with an existing order management system.
3.4.External Inventory
External inventory is used to integrate WebSphere Commerce with external inventory systems. External inventory is the legacy inventory implementation model where WebSphere Commerce directly consumes the inventory information from an external system.
3.5.DOM inventory system
DOM inventory is used for WebSphere Commerce distributed order management integration. For the DOM inventory system,WebSphere Commerce calls outbound services to allocate inventory externally. Integration with Sterling Order Management is based on the DOM inventory model. The DOM inventory system differs from the external inventory model in the following ways:
1)The DOM inventory model supports the local inventory cache in WebSphere Commerce. The external inventory model does not support the use of the local inventory cache.
2)The DOM inventory model uses the new logical schema and outbound service interfaces. The external inventory model uses the legacy inventory outbound service interfaces.
4.Calculation codes for orders
Calculation codes represent ways of determining monetary amounts associated with OrderItems. The CalculationCode object and its associated CalculationMethod objects define how to calculate amounts such as price adjustments (coupons and discounts), shipping charges, and taxes.
The OrderCalculate and OrderPrepare commands determine which kinds of calculations should be performed by inspecting the STENCALUSG table. OrderCalculate will accept the `calculationUsageId' parameter, which will determine the kinds of charges calculated in OrderCalculate. (You can define additional kinds of calculations to be performed, and provide or extend the business logic associated with each kind of calculation.)
The default CalculationMethod objects determine which CalculationCode objects apply to the items in an Order by searching for attachment relationships in the CATENCALCD, CATGPCALCD, ORDCALCD, and ORDICALCD tables. They calculate their amounts and, in addition to quantitative attributes of the product such as weight, quantity, and price, they take into account the following attributes:
1)Calculation code
2)Member group membership
3)calculation scales
4)Start and end dates
5)Sequence in which calculations should be performed
5.Fulfillment centers
Stores use fulfillment centers as both inventory warehouses and shipping and receiving centers. One store can have one or many fulfillment centers.
WebSphere Commerce can designate a fulfillment center as being `Drop Ship'. This involves requesting a fulfiller to ship the items directly to the customer rather than from the seller's own fulfillment center. A fulfillment center requests a pick batch (a group of releases that are managed as a unit) for a specified fulfillment center and store. The default behavior is to group up to 25 releases in the pick batch. But even when fewer than 25 releases are present in the database, a pick batch will be created for those releases.
From a WebSphere Commerce Server perspective, a FulfillmentCenter object is separate from the Store object. It manages product inventory and shipping. To ship an order, the fulfillment center relies on a ShippingMode object that is specified by the customer. The ShippingMode object indicates the shipping carrier and method of shipping for fulfilling the customer's order.
In a fulfillment center, the ShippingArrangement object indicates that a Store object has arranged with a FulfillmentCenter object to ship products using a certain ShippingMode, within a certain time range. For example: a store has an arrangement with its fulfillment center to ship an order within 24 hours if the customer selects an express shipping option.
6.Pricing and offers
Offers present different prices for the same product or SKU to different customers. In WebSphere Commerce, an offer is also known as a trading position. An offer represents the price of a catalog entry and criteria that the customer must satisfy in order to pay that price.
The Offer object has a quantity range attribute that specifies the minimum or maximum quantity that can be sold in an order under the available offer. The Offer object also indicates a date range and the member groups of the trading position container (price list).
An Offer object is part of a TradingPositionContainer (PriceList), which is owned by a member. A TradingPositionContainer contains TradingPositions. It can be made available to all customers, or only to customers in certain groups by using the trading agreements or contracts. There are three kinds of price lists:
S:Standard price list which contains the base prices for the products in the store catalog.
C:Custom price list which specifies the list of products and their customized prices.
E:Custom price list which specifies the list of products and their customized prices, but improves performance during maintenance.
7. WCS Order flow Process
7.1.Add To Cart
User is browsing the site as anonymous, guest or authenticated user and adds an item from browse pages to cart
You can call the OOB non AJAX version "/OrderChangeServiceItemAdd" which is mapped as follows in struts-config
<action parameter="com.ibm.commerce.orderitems.commands.OrderItemAddCmd" path="/OrderChangeServiceItemAdd" type="com.ibm.commerce.struts.BaseAction">
</action>
If you want to use AJAX version use "/AjaxOrderChangeServiceItemAdd" command
<action parameter="order.addOrderItem" path="/AjaxOrderChangeServiceItemAdd" type="com.ibm.commerce.struts.AjaxComponentServiceAction">
</action>
Refer following link for various AJAX actions supported by this Fascade
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.madisons-starterstore.doc/refs/rsmmadisonorderservices.htm
Both AJAX and non AJAX finally make use of following implementation This uses following OOB controller command
com.ibm.commerce.orderitems.commands.OrderItemAddCmdImpl
- Extends com.ibm.commerce.orderitems.commands.OrderItemBaseCmdImpl
Any customization would require extension of OOB OrderItemAddCmdImpl
User clicks on add to cart it calls the OrderFacadeClient addOrderItem() method From there OrderItemAddCmd will be invoked. OrderItemAddCmd will in turn call the OrderCalculate and from there OrderItemDisplayCmd is invoked. OrderItemDisplayCmd will call the OrderItemDisplayView which will display the shopping cart with the newly added item.
7.2.View Cart
User clicks on View Cart Page
At this step you want to display guest the cart content with list of order items with pending order status
You can use following OOB Struts action url "/OrderItemDisplay"
<action
parameter="com.ibm.commerce.orderitems.commands.OrderItemDisplayCmd"
path="/OrderItemDisplay" type="com.ibm.commerce.struts.BaseAction">
<set-property property="https" value="0:1"/>
<set-property property="authenticate" value="0:0"/>
</action>
Review following link for more details on optional and mandatory input parameters for this URL
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/refs/rosorderitemdisplay.htm
This action internally makes use of following OOB controller command
com.ibm.commerce.orderitems.commands.OrderItemDisplayCmdImpl
Control the various calculations that needs to be performed before you display the Cart Page
E.g by passing following in URL calculationUsageId=-1&calculationUsageId=-2&calculationUsageId=-7 you are triggering calculation of Tax, discount, Shipping
Any customization would require extension of OOB OrderItemDisplayCmdImpl
7.3.Update Cart Item
User changes quantity and clicks on update button it will call the OrderFacadeClient updateOrderItem() method.From there OrderItemUpdateCmd will be invoked. OrderItemUpdateCmd will in turn call the OrderCalculate and then OrderItemDisplayCmd is invoked. OrderItemDisplayCmd will call the OrderItemDisplayView which will display the modified shopping cart.
7.4.Delete Cart Item
User clicks on delete control will go to OrderFacadeClient updateOrderItem() method .From there OrderItemUpdateCmd will be invoked. OrderItemUpdateCmd will inturn call the OrderCalculate and from there OrderItemDisplayCmd is invoked. The OrderItemDisplayCmd will call the OrderItemDisplayView which will display the modified shopping cart.
7.5.Checkout
User clicks on checkout and is navigated to shipping page
<action
parameter="com.ibm.commerce.orderitems.commands.OrderItemUpdateCmd"
path="/OrderItemUpdate" type="com.ibm.commerce.struts.BaseAction">
<set-property property="https" value="0:1"/>
<set-property property="authenticate" value="0:0"/>
</action>
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/refs/rosorderitemupdate.htm
This action used following OOB command com.ibm.commerce.orderitems.commands.OrderItemUpdateCmdImpl
User clicks on checkout it will call OrderFacadeClient updateOrderItem() method.From there OrderItemUpdateCmd will be invoked. OrderItemUpdateCmd will in turn call the OrderCalculate and then forward to the OrderShippingBillingView.
7.6.Enter Shipping\Billing Address
User enters shipping address and submit then control will go to OrderFacadeClient updateOrderShippingInfo() method. From there OrderItemUpdate command is called.OrderItemUpdate will call the OrderCalculate and will forward to OrderShippingBillingView.
7.7.Enter Payment Information
User navigates to payments page
This flow typically includes adding single/multiple payment information to an order, once the payment information is submitted
we can use following command for processing before forwarding user to review order screen
The OOB /OrderProcess should be used for this purpose,
it is implemented by following OOB command com.ibm.commerce.order.commands.OrderPrepareCmdImpl
Pass appropriate payment parameters to add the payment information entered to an Order.
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/refs/rosorderprocess.
User Enters Payment information and press confirm order ,the client calls the order facade client method prepareOrder().This is followed by OrderFacdeClient addPaymentInstruction() method that invokes PIAddCmd and then forward to OrderSummaryView.If user updates the payment information OrderFacdeClient updatePaymentInstruction() method is called which inturn will call the PIEditCmd and will forward to OrderSummaryView. If user remove the payment information orderFacdeClient removePaymentInstruction() method is called which in turn will call the PIRemoveCmd and will forward to OrderSummaryView.
7.8.Place\Submit Order
User navigates to review order page and submits order
The OOB /OrderProcess should be used for final Order submission, as mentioned in previous step this URL
implements OOB com.ibm.commerce.order.commands.OrderProcessCmdImpl command.
Order Submission and post processing
Once an Order is submitted OrderProcessCmdImpl Calls RaiseOrderEventCmd to raise ORDER_SUBMISSION_EVENT
com.ibm.commerce.order.event.RaiseOrderSubmitEventCmd
any customization to this command would require extension of
com.ibm.commerce.order.event.RaiseOrderSubmitEventCmdImpl command which is the default implementation.
com.ibm.commerce.order.event.ProcessOrderSubmitEventCmdImpl which is default implementation of OOB
com.ibm.commerce.order.event.ProcessOrderSubmitEventCmd listens to ORDER_SUBMISSION_EVENT and takes care
of transferring the order to the external system.
This is the appropriate command for customization If you need any customization in Order XML which is posted to external system
User clicks on place or submit order OrderFacadeClient processOrder() method will be called. This in turn will call the Order Process command and will forward to the OrderShippingBillingConfirmationView.
8.Complete Order Flow commands are listed below
8.1.OrderItemAddCmdImpl
public class OrderItemAddCmdImpl
extends OrderItemBaseCmdImpl
implements OrderItemAddCmd
Adds items or products to the list of items that are to be shipped.
This command accepts enumeration type of parameters. That is, it accepts parameterName_i=parameterValue.
For example, to add three catalog entries with id 15, 16, and 17 to the OrderItems, you can pass catEntryId_1=15&catEntryId_2=16&catEntryId_3=17 to the command. If you call the individual set method to pass the above parameters, you need to create a hashtable and add the following to the hashtable:
hashtable.put(new Integer(1), new String("15"));
hashtable.put(new Integer(2), new String("16"));
hashtable.put(new Integer(3), new String("17"));
then passed the hashtable to the method setCatEntryId(Hashtable).
This command adds items or products to the shopping cart. OrderItemAddCmdImpl calls the below commands in this sequence.
1)ResolveSkuCmdImpl
2)OrderCreateCmd
3)ResolveOrderItemPriceCmd
4)UpdateShippingAddressCmd
5)ValidateTradingPaymentCmd
6)DoInventoryActionCmd(CheckInventory)
7)UpdateShipInfoCmdImpl
8)RaiseOrderEventCmdImpl
9)OrderCalculateCmd
10)ExtendedOrderItemProcessCmd
1)ResolveSkuCmdImpl
This command finds the type of catalog entry. If it is a package then PackageResolveSkuCmd is called. If it is a product then this command determines the attributes required to resolve the product to an orderable item. If attributes are missing then ErrorMissingAttributeErrorCmd or ErrorProductAttributeErrorCmd is called.
2)OrderCreateCmd
This order command is used to create an order container with no line items.
3)ResolveOrderItemPriceCmd
This command is used to resolve price for a group of order items from one order.This command calculates the best price for the input OrderItems. It calls GetContractUnitPriceCmd or GetContractSpecialPriceCmd task command to calculate the price. If GetContractUnitPriceCmd/GetContractSpecialPriceCmd is not available, it calls GetBaseUnitPriceCmd/GetBaseSpecialPriceCmd. If input trading agreements and/or offers are specified, they will be used providing they are valid. Otherwise, eligible trading agreements will be obtained.
4)UpdateShippingAddressCmd
This Order task command is used to update the shipping address for the passed order items
5)ValidateTradingPaymentCmd
ValidateTradingPaymentCmd is called to validate that the payment method is compatible with the trading agreement
6)DoInventoryActionCmd(CheckInventory)
If doInventory = Y, call DoInventoryActionCmd to update the fulfillment centers and check for available inventory
7)UpdateShipInfoCmdImpl
Call UpdateShipInfoCmd to update the shipping instructions, shipping account number and shipping charge type
8)RaiseOrderEventCmdImpl
Call RaiseOrderEventCmd to raise ORDERITEM_CREATION_EVENT or ORDERITEM_UPDATE_EVENT
9)OrderCalculateCmd
If the flag calculateOrder is set then Call OrderCalculateCmd to do calculations that are based on the calUsageIds passed in
10)ExtendedOrderItemProcessCmd
Call ExtendOrderItemProcessCmd to execute any customization logic
8.2.OrderItemUpdateCmdImpl
public class OrderItemUpdateCmdImpl
extends OrderItemBaseCmdImpl
implements OrderItemUpdateCmd
Add products or items to the order list or update the products and items in the existing order list.
This command can do all that OrderItemAdd command can do. In addition, it can also update products and items in the existing order list.
This command accepts enumeration type of parameters. That is, it accepts parameterName_i=parameterValue.
For example, to add three catalog entries with id 15, 16, and 17 to the OrderItems, you can pass catEntryId_1=15&catEntryId_2=16&catEntryId_3=17 to the command. If you call the individual set method to pass the above parameters, you need to create a hashtable and add the following to the hashtable:
hashtable.put(new Integer(1), new String("15"));
hashtable.put(new Integer(2), new String("16"));
hashtable.put(new Integer(3), new String("17"));
then passed the hashtable to the method setCatEntryId(Hashtable).
The command will execute each enumeration group one by one. But the order of execution is not guaranteed. So if you pass two orderItemId with the same number, the result is unpredictable.
When updating the order item with quantity = 0, this order item will be deleted. If you delete the same order item twice in one transaction, it will throw a remote exception.
OrderItemUpdateCmdImpl command updates order items in an existing Order.OrderItemUpdateCmdImpl calls the following commands in sequence
1)DoInventoryActionCmd(Reserve Inventory)
2)AddOrderItemComponentsCmd
3)ResolveOrderItemPriceCmd
4)UpdateShippingAddressCmd
5)ValidateTradingPaymentCmd
6)DoInventoryActionCmd(Check Inventory)
7)updateShipInfoCmdImpl
8)RaiseOrderEventCmdImpl
9)OrderCalculateCmd
10)ExtendedOrderItemProcessCmd
1)DoInventoryActionCmd(Action : Reserve Inventory)
In ATP inventory systems it calls the command ReserveInventoryCmd. In Non-ATP inventory systems calls the UpdateInventoryCmd.
ReserveInventoryCmd
This command get the quantity available for the requested item, store, and fulfillment center.This command check to make sure that the quantity available is greater or equal to the quantity requested.If it is successful,obtain the ITEMFFMCTR row and increment the itemffmctr.qtyreserved by the requested quantity,then insert a new row into the INVRESERVE table.
UpdateInventoryCmd
UpdateInventory let you update inventory for items. There are two ways to update inventory.Set one or list of order items by calling setOrderItem method.Set one catalog entry by calling setCatEntryId, setQuantity and setStoreId methods. Method setQuantityMeasure is optional.
2)AddOrderItemComponentsCmd
This command creates the components that are associated with a composite order item. It derives the component list in one of two ways
1. By making use of a list of CatalogEntries that are passed in
2. Get the list of components by finding all of the unassigned components through the given configuration id.
3)ResolveOrderItemPriceCmd
This command is called to calculate the best price and update order total.
4)UpdateShippingAddressCmd
This Order task command is used to update the shipping address for the order items passed in the request.
5)ValidateTradingPaymentCmd
ValidateTradingPaymentCmd is called to validate that the payment method is compatible with the trading agreement.
6)DoInventoryActionCmd(Check Inventory)
Check Inventory allows us to check inventory for items. There are two ways to check inventory.
1) Set one or list of order items by calling setOrderItem method.
2) Set one catalog entry by calling setCatEntryId, setQuantity and setStoreId methods. Method setQuantityMeasure is optional.
7)updateShipInfoCmdImpl
Call UpdateShipInfoCmd to update the shipping instructions, shipping account number and shipping charge type.
8)RaiseOrderEventCmdImpl
Call RaiseOrderEventCmd to raise ORDERITEM_CREATION_EVENT or ORDERITEM_UPDATE_EVENT.
9)OrderCalculateCmd
If the flag calculateOrder is set Call OrderCalculateCmd to do calculations that are based on the calUsageIds passed in.
10)ExtendedOrderItemProcessCmd
Call ExtendOrderItemProcessCmd to execute any customization logic.
8.3.OrderItemDeleteCmdImpl
public class OrderItemDeleteCmdImpl
extends OrderBaseCmdImpl
implements OrderItemDeleteCmd
This is the default implementation of the OrderItemDeleteCmd controller command.
This command delete order items based on orderItemId or catEntryId specified.OrderItemDeleteCmdImpl calls below commands in sequence.
1)DoInventoryActionCmd(ReserveInventory)
2)PrepareShipInfoCmd
3)ReolveOrderItemPriceCmd
4)OrderCalculateCmd
1)DoInventoryActionCmd(Action : Reserve Inventory)
In ATP inventory systems it calls the command reserveInventoryCmd. In Non-ATP inventory systems calls the updateInventoryCmd.
ReserveInventoryCmd
Get the quantity available for the requested item, store, and fulfillment center.Check to make sure that the quantity available is greater or equal to the quantity requested.If the above edit is successful,obtain the ITEMFFMCTR row and increment the itemffmctr.qtyreserved by the requested quantity,then insert a new row into the INVRESERVE table.
updateInventoryCmd
UpdateInventory let you update inventory for items. There are two ways to update inventory.Set one or list of order items by calling setOrderItem method.Set one catalog entry by calling setCatEntryId, setQuantity and setStoreId methods. Method setQuantityMeasure is optional.
2)PrepareShipInfoCmd
Perform a verification between the SHIPINFO table and the ORDERITEMS table and check for orphaned SHIPINFO records. Any orphaned records will be removed.
3)ReolveOrderItemPriceCmd
This command is used to resolve price for a group of order items from one order.This command calculates the best price for the input OrderItems.This command calls the GetContractUnitPriceCmd/GetContractSpecialPriceCmd task command to calculate the price.
If GetContractUnitPriceCmd/GetContractSpecialPriceCmd is not available, it calls the GetBaseUnitPriceCmd/GetBaseSpecialPriceCmd. If input trading agreements and/or offers are specified, they will be used providing they are valid. Otherwise, eligible trading agreements will be obtained.
4)OrderCalculateCmd
If the flag calculateOrder is set Call OrderCalculateCmd to do calculations that are based on the calUsageIds passed in.
8.4.OrderPrepareCmd (Controller Command)
public interface OrderPrepareCmd
extends ControllerCommand
This command prepares an order by determining prices, discounts, shipping charges, shipping adjustment, and taxes for an order. If an order reference number is not specified, all current pending orders will be prepared for the current customer at the given store. The default implementation of this command is OrderPrepareCmdImpl. The OrderPrepareCmd URL is mapped to this controller command.
Prepares an order by determining its prices, discounts, shipping charges, and taxes. If an order reference number is not specified, all current pending orders will be prepared for the current customer at the given store. The remerge, merge, check, allocate, backorder and reverse parameters are applicable only if ATP inventory is enabled (STORE Table INVENTORYSYSTEM column value -1).
OrderPrepareCmd calls the following commands in sequence
1.PrepareOrderCmd(Task Command)
2.ValidateShippingAdjustmentCmd
PrepareOrderCmd(Task Command)
PrepareOrderCmd task command prepares an order by determine its prices, discounts, shipping charges, and taxes for an order. This command will also lock the order to indicate that it is ready for submission for the Order Process command. The lock can be reset either by expiry, by changing the Order during update or delete operations or by calling OrderUnlockCmd.The expiry period for a lock is stored in STORE table column QUOTEGOODFOR.
This command removes generated order item based on the prepare flags setting (PREPARE FLAG = 1 which means generated) in ORDERITEMS table. This command will also check if all order items are buyable and throw exceptions if they are not buyable. UpdateShippingAddressCmd is called to find the appropriate shipping address for all the order items and update them for each order item. For a dynamic kit ValidateDynamicKitConfigurationCmd is called to do validation. ResolveOrderItemPriceCmd is called to calculate the best price and update order total. DoInventoryActionCmd is called for inevntoy check and allocation .CalculateOrderCmd is called for calculation of charges.
ValidateShippingAdjustmentCmd
This Order task command is used to find any inconsistencies in the order's shipping adjustments. If new items have been added then the value returned from hasShoppingCartChanged() will be true else it will be false.
8.5.OrderProcessCmd (Controller Command)
public interface OrderProcessCmd
extends ControllerCommand
This Order controller command is used to submit an order. The order must have been locked by OrderPrepare. Once the OrderProcess command begins running, the order cannot be cancelled with OrderCancel.
The default implementation of this command is OrderProcessCmdImpl.
The OrderProcessCmd URL is mapped to this command.
This command submits an order for processing. The order must be locked by the Order Prepare command before calling this command.
OrderProcessCmd calls the following commands in the below sequence
1)PIAddCmd
This controller command is used to create a new payment method to an order.
2)ValidatePaymentMethodCmd
This command checks whether the payment method to be added comply with the Buy Online Pick In Store (BOPIS) rules.
3)ProcessOrderCmd
The ProcessOrderCmd task command makes the ProcessOrder server request.
4)RaiseOrdereventCmd
The RaiseOrderEventCmd task command is used to raise an order related event
ProcessOrderCmd (Task Command)
ProcessOrderCmd makes the ProcessOrder server request.ProcessOrderTaskCmd calls commands in sequence as shown below.
1)PreProcessOrderCmd
If Unified Business Flow is not enabled or is enabled and approval is needed then this command is called.
2)DoInventoryActionCmd(getATPParameter)
Call DoInventoryActionCmd to update inventory.
3)UpdateSependingLimitCmd
Call UpdateSpendingLimitCmd to check the trading agreement spending limit and validate the PO number.
4)PrimePaymentCmd
Call PrimePaymentCmd (EDP command) to guarantee that the customer has funds to pay for the order.
5)RaiseOrderSubmitEventCmd
Call RaiseOrderSubmitEventCmd to raise the order submit event.
6)PersisitOrdersWithMemberGroupIdsForCurrentUserCmd
PersistOrdersWithMemberGroupIdsForCurrentUserCmd (Marketing command) is called If OrdersMgpPersistListener is enabled in order to persist the orders_id with the member group id.
7)ExtOrderProcesCmd
ExtOrderProcessCmd command is called to execute any customization logic during order process flow.
8)TransferOrderCmd
This command confirms successful transfer of an order to an external system. This command is called to generate the outbound Order Create Message.
9)OrderMessagingCmd
This command generates the outbound Order Create Message "Report_NC_PurchaseOrder".
9.Tables Involved with Order Subsystem
9.1.ORDERS
Each row in this table represents an order in a store.
9.2.SUBORDERS
Each row of this table contains subtotals of amounts for all the OrderItems of an Order with the same shipping address.
9.3.ORDADJUST
Each row of this table represents an OrderAdjustment.
9.4.ORDIADJUST
Each row in this table represents an OrderItemAdjustment.
9.5.ORDADJTXEX
Each row of this table indicates that an OrderAdjustment is exempt from taxation of a particular TaxCategory. For example, an "after tax rebate" can be represented as a negative OrderAdjustment that is exempt from taxation of all TaxCategories.
9.6.ORDCALCD
Each row of this table indicates to the CalculationCodeCombineMethod that a CalculationCode is directly attached to all OrderItems in an Order. The order directCalculationCodeAttachment flag in ORDERITEMS.PREPAREFLAGS is 1.
9.7.ORDERITEMS
Each row of this table represents an order item in an order.
9.8.ORDPROMOCD
This table contains promotion codes captured for an order.
9.9.CPENDORDER
Each row of this table indicates that an order is marked as current for a customer in a store, if its status is "P" (Pending).
9.10.ORDPAYINFO
Each row in this table holds a name-value pair representing payment information for a particular Order. Values added to this table are encrypted when the "Instance/PDIEncrypt" configuration flag is "on".
9.11.ORDICALCD
Each row of this table indicates to the CalculationCodeCombineMethod that a CalculationCode is directly attached to an OrderItem. The attachment is not effective unless the directCalculationCodeAttachment flag in ORDERITEMS.PREPAREFLAGS is 1.
9.12.ORDTAX
Each row of this table represents the total of the tax amounts of a particular TaxCategory for all the OrderItems in an Order.
9.13.SUBORDTAX
Each row of this table specifies the tax amount of a particular TaxCategory for all the OrderItems with the same shipping address as the SubOrder.
9.14.ORDITAX
Each row of this table contains a tax amount of a particular TaxCategory, for an OrderItem. By default, WebSphere Commerce does not save any data in this table. However tax amounts are aggregated by TaxCategory in the SUBORDTAX and ORDTAX tables.
9.15.ORCOMMENT
The table stores the comments for an order entered by a customer service representative.
9.16.ORDERHIST
This table is used to save order snapshots in XML format.
9.17.ORDSTAT
This table contains information about the status of an order for an Order Status Update inbound message. Each row in the table contains information about a single order.
9.18.ORDUSERS
Contains information about users that worked with an order.
Catalog Subsystem in WCS
The catalog subsystem provides the functionalities like on-line catalogue navigation, partitioning, categorization and association.
1)Master Catalog
It is the single catalog that contains all products, items, relationships, and standard prices for everything that is for sale in your store.Every store in the WebSphere Commerce system must have a master catalog. You can share the master catalog across stores and define as many stores as needed.
In addition to creating a master catalog for your catalog management, you might also choose to create one or more sales catalogs for display purposes. A sales catalog can contain the same entries as the master catalog, but the sales catalog has a flexible structure for customer display purposes. You can have as many sales catalogs as you want.
Use the Management Center Catalogs tool to view and manage your master catalog.
It is very important that the master catalog must be in a proper tree. For example, the parent category "Women" has a subcategory "WomenDress". It is important that WomenDress and any of WomenDress's subcategories like tops,jeans etc are not the parent category of "Women" category.
2)Sales Catalog
A sales catalog is a subset of the merchandise and services that are found in the master catalog.
You can create one or more sales catalogs for customer display purposes. A sales catalog has a flexible display structure that can associate products to more than one sales category, to suit the requirements of your store.
3)Default Catalog
A store has one master catalog and can have one or more sales catalogs. If your store has more than one catalog, you can specify a default catalog. Selecting a default catalog ensures that a shopper that visits your store without specifying a catalog in the URL, views the default catalog in the storefront.
To set the default catalog, use the Catalogs tool.
4)Products : Product is a group of items which exhibit same attributes. we can say Shirt is a products, but a shirt of red color of size 44 is a item. So it is clear in this example that there are two attributes size and color which belong to this item. And we can also say , that items belong to a particular product exhibit the same set of attributes.
5)Items : An item is a tangible unit of merchandise that has a specific name, part number,size and price. For example, a 44 size shirt with red color is an item for the above item.
6)SKU :Quantity is always attached to SKU ( Stock keeping unit ) .SKUs to represent each orderable item of merchandise for sale.
7)Catalog Groups
The main intent of catalog group is for partitioning and they determines navigational hierarchy of an online catalog.
8)Package and Bundle
A bundle is a collection of catalog entries that allow customers to buy multiple items with one click. A package is an atomic collection of catalog entries. A fully resolved package is comparable to an item, with its own price, and can be added to a shopping cart.
Packages can be unresolved or fully resolved. It is important to remember that only fully resolved packages can be added to an order. For example, a fully resolved computer package might contain a specific central processing unit, monitor, and hard drive that cannot be sold separately.
Components or products under bundle can be modified before adding to cart or after adding to cart. Components or products under package can't be modified
The association between the Package object and Bundle object is modeled in the CATENTREL table.
9)Dynamic kit and Static kit
A dynamic kit is a typeof catalog entry which can be dynamically configured by the customer.
A dynamic kit is a group of products that are ordered as a unit. The information about the products contained in a dynamic kit is controlled by an external configurator and supplied at order entry time. A dynamic kit's components are only tracked when your store uses the ATP inventory model. If your store uses the non-ATP inventory model, a dynamic kit will be treated as a single product.
A static kit is a groupof products that are ordered as a unit. The information about the productscontained in a static kit is predefined and controlled within WebSphereCommerce.A static kit is also a group of products that are ordered as a unit. The information about the products contained in a static kit is predefined and controlled within WebSphere Commerce. A static kit's components are only tracked when your store uses the ATP inventory model. If your store uses the non-ATP inventory model, a static kit will be treated as a single product. The individual components within the order cannot be modified and must be fulfilled together. A static kit will backorder if any of its components are unavailable.
Tables Used in Catalog Subsystem
1.STORECAT
This table holds the relationship between StoreEntities and the Catalogs that they offer.
Column Descriptions:
Name Type Description
CATALOG_ID BIGINT NOT NULL The reference number of the Catalog.
STOREENT_ID INTEGER NOT NULL The reference number of the StoreEntity.
MASTERCATALOG CHAR (1) Specifies a master catalog for the Store. A value of 1 indicates that this Catalog is designated as a master catalog.
LASTUPDATE TIMESTAMP Indicates the last time that this relationship was updated.
OPTCOUNTER SMALLINT The optimistic concurrency control counter for the table. Every time there is an update to the table, the counter is incremented.
Indexes:
Name Column Names Type
<SYSTEM-GENERATED> CATALOG_ID+STOREENT_ID Primary Key
I0000782 STOREENT_ID Non-Unique Index
2.CATCONFINF
This table holds additional information for catalog entries that represent configurable products. This information may be required by an external configurator to configure these catalog entries.
3.CATTOGRP
This table identifies the root catalog groups (or root categories) contained within a catalog.
4.OICOMPLIST
Each row contains information about the components of a configured Order Item.
5.OICOMPREL
Stores all kit level information for an Order item that is a kit. A kit may contain other kits and catalog entries outside of a kit. This table stores information about kit components and the OICOMPLIST table stores information about catalog entries outside of a kit.
6.CATALOG :This table holds the information related to a catalog.
Name Type Description
CATALOG_ID BIGINT NOT NULL The internal reference number of the catalog.
MEMBER_ID BIGINT NOT NULL The internal reference number that identifies the owner of the catalog. Along with the IDENTIFIER, these columns are a unique index.
IDENTIFIER VARCHAR (254) NOT NULL The external identifier used to identify the catalog. Along with the MEMBER_ID, these columns are a unique index.
DESCRIPTION VARCHAR (254) An administrative description of the catalog.
TPCLEVEL INTEGER Reserved for IBM internal use.
OPTCOUNTER SMALLINT The optimistic concurrency control counter for the table. Every time there is an update to the table, the counter is incremented.
Indexes:
Name Column Names Type
<SYSTEM-GENERATED> CATALOG_ID Primary Key
I0000061 MEMBER_ID+IDENTIFIER Unique Index
CATGROUP :This table hold the information related to a catalog group. A catalog group is similar to a generic category that can contain both other catalog groups and also catalog entries.
CATGRPDESC :This table holds the language-dependent information related to a catalog group.
URLS
1)StoreCatalogDisplay
2)TopCategoriesDisplay
3)CategoryDisplay
4)ProductDisplay
Commands
1)StoreCatalogDisplayCmdImpl
This command sets the view task that will display the Catalogs available to browse in the current Store.
2)TopCategoriesDisplayImpl
This command sets the view task that will display the root Categories in a specified Catalog.
3)CategoryDisplayCmdImpl
retrieves the configured display page for the specified category in the specified catalog.
4)ErrorMissingAttributeCmd
This error task command is set when a Product to Item resolution fails due to missing product attributes.
5)ErrorProductAttributeCmd
This error task command is set when a Product to Item resolution fails due to incorrect product attributes
6)ProductDisplayCmdImpl
This command retrieves the configured Display Page for the specified CatalogEntry which will in turn be launched in order to
display information about the CatalogEntry.This command first ensures that the CatalogEntry specified by the
ProductId can be displayed in the current store, if published, and is not marked for delete.
7)ResolveSkuCmd-Certain catalog entries may need further processing before being added to an order. An example is resolving a product into an item through SKU resolution, performed by the ResolveSkuCmd task command.
DataBeans--
1)StoreDataBean--extends StoreAccessBean ->salesCatalogs()
2)CatalogDataBean-extends CachedCatalogAccessBean ->getTopCategories()
3)CategoryDataBean-extends CachedCatalogAccessBean ->getSubCategories()
4)CatalogEntryDataBean-extends CachedCatalogEntryAccessBean
5)ProductDataBean-extends CachedProductAccessBean
1)Master Catalog
It is the single catalog that contains all products, items, relationships, and standard prices for everything that is for sale in your store.Every store in the WebSphere Commerce system must have a master catalog. You can share the master catalog across stores and define as many stores as needed.
In addition to creating a master catalog for your catalog management, you might also choose to create one or more sales catalogs for display purposes. A sales catalog can contain the same entries as the master catalog, but the sales catalog has a flexible structure for customer display purposes. You can have as many sales catalogs as you want.
Use the Management Center Catalogs tool to view and manage your master catalog.
It is very important that the master catalog must be in a proper tree. For example, the parent category "Women" has a subcategory "WomenDress". It is important that WomenDress and any of WomenDress's subcategories like tops,jeans etc are not the parent category of "Women" category.
2)Sales Catalog
A sales catalog is a subset of the merchandise and services that are found in the master catalog.
You can create one or more sales catalogs for customer display purposes. A sales catalog has a flexible display structure that can associate products to more than one sales category, to suit the requirements of your store.
3)Default Catalog
A store has one master catalog and can have one or more sales catalogs. If your store has more than one catalog, you can specify a default catalog. Selecting a default catalog ensures that a shopper that visits your store without specifying a catalog in the URL, views the default catalog in the storefront.
To set the default catalog, use the Catalogs tool.
4)Products : Product is a group of items which exhibit same attributes. we can say Shirt is a products, but a shirt of red color of size 44 is a item. So it is clear in this example that there are two attributes size and color which belong to this item. And we can also say , that items belong to a particular product exhibit the same set of attributes.
5)Items : An item is a tangible unit of merchandise that has a specific name, part number,size and price. For example, a 44 size shirt with red color is an item for the above item.
6)SKU :Quantity is always attached to SKU ( Stock keeping unit ) .SKUs to represent each orderable item of merchandise for sale.
7)Catalog Groups
The main intent of catalog group is for partitioning and they determines navigational hierarchy of an online catalog.
8)Package and Bundle
A bundle is a collection of catalog entries that allow customers to buy multiple items with one click. A package is an atomic collection of catalog entries. A fully resolved package is comparable to an item, with its own price, and can be added to a shopping cart.
Packages can be unresolved or fully resolved. It is important to remember that only fully resolved packages can be added to an order. For example, a fully resolved computer package might contain a specific central processing unit, monitor, and hard drive that cannot be sold separately.
Components or products under bundle can be modified before adding to cart or after adding to cart. Components or products under package can't be modified
The association between the Package object and Bundle object is modeled in the CATENTREL table.
9)Dynamic kit and Static kit
A dynamic kit is a typeof catalog entry which can be dynamically configured by the customer.
A dynamic kit is a group of products that are ordered as a unit. The information about the products contained in a dynamic kit is controlled by an external configurator and supplied at order entry time. A dynamic kit's components are only tracked when your store uses the ATP inventory model. If your store uses the non-ATP inventory model, a dynamic kit will be treated as a single product.
A static kit is a groupof products that are ordered as a unit. The information about the productscontained in a static kit is predefined and controlled within WebSphereCommerce.A static kit is also a group of products that are ordered as a unit. The information about the products contained in a static kit is predefined and controlled within WebSphere Commerce. A static kit's components are only tracked when your store uses the ATP inventory model. If your store uses the non-ATP inventory model, a static kit will be treated as a single product. The individual components within the order cannot be modified and must be fulfilled together. A static kit will backorder if any of its components are unavailable.
Tables Used in Catalog Subsystem
1.STORECAT
This table holds the relationship between StoreEntities and the Catalogs that they offer.
Column Descriptions:
Name Type Description
CATALOG_ID BIGINT NOT NULL The reference number of the Catalog.
STOREENT_ID INTEGER NOT NULL The reference number of the StoreEntity.
MASTERCATALOG CHAR (1) Specifies a master catalog for the Store. A value of 1 indicates that this Catalog is designated as a master catalog.
LASTUPDATE TIMESTAMP Indicates the last time that this relationship was updated.
OPTCOUNTER SMALLINT The optimistic concurrency control counter for the table. Every time there is an update to the table, the counter is incremented.
Indexes:
Name Column Names Type
<SYSTEM-GENERATED> CATALOG_ID+STOREENT_ID Primary Key
I0000782 STOREENT_ID Non-Unique Index
2.CATCONFINF
This table holds additional information for catalog entries that represent configurable products. This information may be required by an external configurator to configure these catalog entries.
3.CATTOGRP
This table identifies the root catalog groups (or root categories) contained within a catalog.
4.OICOMPLIST
Each row contains information about the components of a configured Order Item.
5.OICOMPREL
Stores all kit level information for an Order item that is a kit. A kit may contain other kits and catalog entries outside of a kit. This table stores information about kit components and the OICOMPLIST table stores information about catalog entries outside of a kit.
6.CATALOG :This table holds the information related to a catalog.
Name Type Description
CATALOG_ID BIGINT NOT NULL The internal reference number of the catalog.
MEMBER_ID BIGINT NOT NULL The internal reference number that identifies the owner of the catalog. Along with the IDENTIFIER, these columns are a unique index.
IDENTIFIER VARCHAR (254) NOT NULL The external identifier used to identify the catalog. Along with the MEMBER_ID, these columns are a unique index.
DESCRIPTION VARCHAR (254) An administrative description of the catalog.
TPCLEVEL INTEGER Reserved for IBM internal use.
OPTCOUNTER SMALLINT The optimistic concurrency control counter for the table. Every time there is an update to the table, the counter is incremented.
Indexes:
Name Column Names Type
<SYSTEM-GENERATED> CATALOG_ID Primary Key
I0000061 MEMBER_ID+IDENTIFIER Unique Index
CATGROUP :This table hold the information related to a catalog group. A catalog group is similar to a generic category that can contain both other catalog groups and also catalog entries.
CATGRPDESC :This table holds the language-dependent information related to a catalog group.
URLS
1)StoreCatalogDisplay
2)TopCategoriesDisplay
3)CategoryDisplay
4)ProductDisplay
Commands
1)StoreCatalogDisplayCmdImpl
This command sets the view task that will display the Catalogs available to browse in the current Store.
2)TopCategoriesDisplayImpl
This command sets the view task that will display the root Categories in a specified Catalog.
3)CategoryDisplayCmdImpl
retrieves the configured display page for the specified category in the specified catalog.
4)ErrorMissingAttributeCmd
This error task command is set when a Product to Item resolution fails due to missing product attributes.
5)ErrorProductAttributeCmd
This error task command is set when a Product to Item resolution fails due to incorrect product attributes
6)ProductDisplayCmdImpl
This command retrieves the configured Display Page for the specified CatalogEntry which will in turn be launched in order to
display information about the CatalogEntry.This command first ensures that the CatalogEntry specified by the
ProductId can be displayed in the current store, if published, and is not marked for delete.
7)ResolveSkuCmd-Certain catalog entries may need further processing before being added to an order. An example is resolving a product into an item through SKU resolution, performed by the ResolveSkuCmd task command.
DataBeans--
1)StoreDataBean--extends StoreAccessBean ->salesCatalogs()
2)CatalogDataBean-extends CachedCatalogAccessBean ->getTopCategories()
3)CategoryDataBean-extends CachedCatalogAccessBean ->getSubCategories()
4)CatalogEntryDataBean-extends CachedCatalogEntryAccessBean
5)ProductDataBean-extends CachedProductAccessBean
RealtimeProjects in WCS: how to build an email message and send it through the outbound messaging system
you can use either SendMsgCmd.setContent or SendMsgCmd.compose to build an email message and send it through the outbound messaging system.
If SendMsgCmd.setContent and SendMsgCmd.compose are used together, content that is generated by composition can override the other according to the following behavior priorities:
If SendMsgCmd.setContent is called with the languageId parameter, its generated content is overridden when SendMsgCmd.compose is called.
If SendMsgCmd.setContent is called without the languageId parameter, its generated content is not overridden when SendMsgCmd.compose is called.
It is not recommended to use both methods, as it adds unnecessary complexity
try
{
com.ibm.commerce.messaging.commands.SendMsgCmd api =
(com.ibm.commerce.messaging.commands.SendMsgCmd)
CommandFactory.createCommand(SendMsgCmd.NAME, getStoreId());
// Assume you have set the msgType in the MSGTYPES table to 200 and you are
using
// storeId of 1.
api.setMsgType("OrderReceived");
api.setStoreID(new Integer(1));
// You have to choice how to build the msg:
// First choice: build your XML msg in a String object and then use the
setContent().
String OrderNotifyMsg =
new String("Your Order has been received. Thank You for Shopping with us.");
// Set the content for English (with language id of -1)
// The first parameter is null. This means that the transport used is dependent on the
// value set in the Administration Console.
SendMsgCmd.setContent(null, "-1" , OrderCreateMsg.getBytes());
// Or, use the message composition services (compose()) by passing the
template/view name
TypedProperty tp = null;
// Pass the viewName, command Context and null parameter stored in tp to composition
// services, assuming the JSP file associating with default view does not require
// any additional values from this command.
// Upon successful completion, a message is build according to message layout
defined in the
// JSP message layout template referred by viewName associated with the
// message type OrderReceive.
SendMsgCmd.compose(null, getCommandContext(), tp);
// Set the subject, recipient and sender information using Configurable message data services.
// To adapt the following example to use the file adapter instead of the e-mail adapter, replace
// the 3 lines of code for the e-mail adapter with the following 2 lines:
// api.setConfigData("location","c:\");
// api.setConfigData("FileName","abc.txt");
api.setConfigData("subject","Your Order has been received");
api.setConfigData("recipient",getEmailAddress());
api.setConfigData("sender","storeAdmin@storeABC.com);
// Send out the message using sendImmediate send service.
api.sendImmediate();
// Set the command context obtained from the controller command.
api.setCommandContext(getCommandContext());
// Run the outbound messaging system services
api.execute();
}
catch (Exception ex )
{
ex.printStackTrace(System.err);
Composition JSP files
The default view for the OrderReceived message is defined in the MSGTYPES table and is the OrderReceivedView. This view is defined in the struts-config-ext.xml file. This view refers to the OrderReceivedNotify.jsp, which is used to compose the message:
<forward className="com.ibm.commerce.struts.ECActionForward" name="OrderReceivedView/10101/-3" path="/Messages/OrderReceivedNotify.jsp">
<set-property property="implClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>
<set-property property="interfaceName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommand"/>
</forward>
See the OrderReceivedNotify.jsp file for details on how the message is composed.
If SendMsgCmd.setContent and SendMsgCmd.compose are used together, content that is generated by composition can override the other according to the following behavior priorities:
If SendMsgCmd.setContent is called with the languageId parameter, its generated content is overridden when SendMsgCmd.compose is called.
If SendMsgCmd.setContent is called without the languageId parameter, its generated content is not overridden when SendMsgCmd.compose is called.
It is not recommended to use both methods, as it adds unnecessary complexity
try
{
com.ibm.commerce.messaging.commands.SendMsgCmd api =
(com.ibm.commerce.messaging.commands.SendMsgCmd)
CommandFactory.createCommand(SendMsgCmd.NAME, getStoreId());
// Assume you have set the msgType in the MSGTYPES table to 200 and you are
using
// storeId of 1.
api.setMsgType("OrderReceived");
api.setStoreID(new Integer(1));
// You have to choice how to build the msg:
// First choice: build your XML msg in a String object and then use the
setContent().
String OrderNotifyMsg =
new String("Your Order has been received. Thank You for Shopping with us.");
// Set the content for English (with language id of -1)
// The first parameter is null. This means that the transport used is dependent on the
// value set in the Administration Console.
SendMsgCmd.setContent(null, "-1" , OrderCreateMsg.getBytes());
// Or, use the message composition services (compose()) by passing the
template/view name
TypedProperty tp = null;
// Pass the viewName, command Context and null parameter stored in tp to composition
// services, assuming the JSP file associating with default view does not require
// any additional values from this command.
// Upon successful completion, a message is build according to message layout
defined in the
// JSP message layout template referred by viewName associated with the
// message type OrderReceive.
SendMsgCmd.compose(null, getCommandContext(), tp);
// Set the subject, recipient and sender information using Configurable message data services.
// To adapt the following example to use the file adapter instead of the e-mail adapter, replace
// the 3 lines of code for the e-mail adapter with the following 2 lines:
// api.setConfigData("location","c:\");
// api.setConfigData("FileName","abc.txt");
api.setConfigData("subject","Your Order has been received");
api.setConfigData("recipient",getEmailAddress());
api.setConfigData("sender","storeAdmin@storeABC.com);
// Send out the message using sendImmediate send service.
api.sendImmediate();
// Set the command context obtained from the controller command.
api.setCommandContext(getCommandContext());
// Run the outbound messaging system services
api.execute();
}
catch (Exception ex )
{
ex.printStackTrace(System.err);
Composition JSP files
The default view for the OrderReceived message is defined in the MSGTYPES table and is the OrderReceivedView. This view is defined in the struts-config-ext.xml file. This view refers to the OrderReceivedNotify.jsp, which is used to compose the message:
<forward className="com.ibm.commerce.struts.ECActionForward" name="OrderReceivedView/10101/-3" path="/Messages/OrderReceivedNotify.jsp">
<set-property property="implClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl"/>
<set-property property="interfaceName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommand"/>
</forward>
See the OrderReceivedNotify.jsp file for details on how the message is composed.
Financial Transactions in WCS
A financial transaction is either a single individual payment or a credit transaction. A payment financial transaction corresponds to a payment action in the Payment rules engine and a credit financial transaction corresponds to a refund action. Every time the Payment rules engine decides the payment or refund action that needs to be run, the corresponding financial transaction is then run in the Payments Plug-in Controller with the Payments Plug-in.
The Payments Plug-in Controller supports the following transaction types:
- approve
- deposit
- approveAndDeposit
- credit
- reverseApproval
- reverseDeposit
- reverseCredit
Depending on the transaction type, the following are different attributes of the financial transaction.
- Response Code
- Reason Code
- Reference Number
- Tracking ID
Subscribe to:
Posts (Atom)
Introduction to Machine Learning
https://www.youtube.com/watch?v=ReoMLN2TtmU&t=10s
-
1.Orders A typical order includes one or more products, billing and shipping addresses, payment details, and the total cost including ship...
-
1.Trading Subsystem The trading subsystem in WebSphere Commerce provides the logic, function and data relevant for negotiating the price ...