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.

Tuesday, May 17, 2011

Deleting a published store in Websphere Commerce

If you want to delete any published store from websphere commerce, there are certain steps to perform as detailed out below.

First, open the accelerator, and select “Extended sites hub”. I am assuming here that there is an extended site. Once the hub opens select the option “View Stores”. Select the store and then click “Delete”. This will delete the store that the consumer can access.

There are other elements of the store that needs to be deleted from the database. A store can be linked to a StoreFrontAssetStore, CatalogAssetStore, etc. Also, stores are associated with fulfilment centres. Hence to delete these objects from the database, use dbclean utility provided by IBM. Following are the steps.

  1. Deleting Store Object
Use dbclean utility to clean up store objects in the database as below

dbclean -object store -type specified -db <<dbname>> -loglevel DEBUG -name <<StoreId>> -instancexml <<WC_Install_Dir>>/instances/<<instance_name>>/xml/<<instance_name>>.xml

  1. Deleting Contract Objects (Only for WCS Enterprise edition)
dbclean -object contract -type obsolete -instancexml <<WC_Install_Dir>>/instances/<<instance_name>>/xml/<<instance_name>>.xml -db <<dbname>> -loglevel DEBUG

  1. Deleting Fulfillment Centre Objects
Use dbclean utility to clean up fulfilment centre objects in the database as below

dbclean -object fulfillment_center -type obsolete -instancexml <<WC_Install_Dir>>/instances/<<instance_name>>/xml/<<instance_name>>.xml -db <<dbname> -loglevel DEBUG

Friday, May 6, 2011

User Authentication issue connecting to a different WCS database instance


There are situations when you try to install a websphere commerce developer instance and then try to point it to a development instance of the database there can be issues with the authentication.

I faced an issue where I connected my local environment to the development db instance and was using the same password for the accelerator on both development environment and my local websphere commerce development environment and it was failing to authenticate the password for the user.

To rectify this, ensure that the attribute “MerchantKey” should match in both the wc-server.xml files (local and dev environment). Apparently it seems that the password encryption/matching are done based on the merchant key.

Also, correspondingly update the SiteAdminPassword (wcsadmin).