Pages

Tuesday, May 24, 2011

Order Locking

All orders in Websphere Commerce are locked before processing by the OrderProcess command or display by the OrderDisplay command. A lock on the order is obtained by calling the OrderPrepare URL which roughly does the following activities before obtaining a lock on the order.

1. Checks the status of the order. (Must be in any of P, I, E, W, or N.) else throw error.
2. Calls PrepareOrder task command which does the following
  • Process order items based on PREPAREFLAGS in ORDERITEMS table
  • Check if the order items are BUYABLE (CATENTRY table)
  • If ATP inventory model, then process DoInventoryActionCmd > GetEligibleFulfillmentCenters, CheckInventoryAvailability, AllocateExistingInventory, AllocateExpectedInventory, DeallocateExistingInventory, DeallocateExpectedInventory
  • If not ATP (Example DOM / External Inventory model) then calls DoInventoryActionCmd ResolveFulfillmentCenter
  • Get new unit prices for items if not manually overridden (PREPAREFLAGS of ORDERITEMS table)
  • Calculate TOTALPRODUCT in ORDERITEMS table for each item * qty
  • Recalculate order amounts based on USEFLAGS in STENCALUSG (store entity calculation usage)
    • If flag is -1,  ApplyOrderAdjustments command is called. This is called only if it has entry in CMDREG table.
    • If flag is -2, ApplyOrderShippingCharges command is called. (has to be in CMDREG)
    • If flag is -3 and -4, ApplyOrderTaxes command is called.
  • Suborder is created (SUBORDER Table) for each shipping address in the order
  • Order is locked (LOCKED field of ORDERS table)
The order lock can be reset by either changing the order (adding / deleting / updating order items), by expiry or by calling OrderUnlock command.

Expiry of the order lock is set at the store level in the QUOTEGOODFOR field of the STORE table.

CSR's can place and modify the order  on behalf of the customer. CSRs lock the order on behalf of the user by setting the forUser parameter for the OrderPrepareCmd.

No comments:

Post a Comment