Handling order and inventory system outages

In the point-to-point integration between HCL Commerce and Sterling Order Management, in the order management system, outages occur, sometimes with long downtime. To avoid impact to the front end, HCL Commerce has a way to deal with the outages in the order capture process.

The Sterling Order Management order management system can schedule outages that affect the HCL Commerce front-end order capture process. HCL Commerce continues to accept orders during any outages by using an exception. HCL Commerce calls heartbeat if an exception is thrown.

Heartbeat is a mechanism that is used to detect the state of the order management systems Inventory and Order components system. In the Sterling Order Management side, a static page for the inventory and order components is provided. HCL Commerce connects to the URL of the static page to verify the state of the inventory and order components through the Service Definition Framework. If HCL Commerce cannot connect to the Service Definition Framework, it considers the system state to be off. Since inventory and order can be deployed separately, HCL Commerce gets each heartbeat through different URLs you can configure in HCL Commerce. Sample URLs are:
  • For the inventory system: http://INVENTORY_SERVER_HOSTNAME:INVENTORY_SERVER_PORT/smcfs/heartbeat/heartbeat.jsp
  • For the order system: http://ORDER_SERVER_HOSTNAME:ORDER_SERVER_PORT/smcfs/heartbeat/heartbeat.jsp

A heartbeat for the inventory system is different than a heartbeat for the order system. With the inventory system heartbeat scheduler, the scheduler adds a job when the system is off. With the order system heartbeat scheduler, the heartbeat is always running. With a scheduled heartbeat job, the heartbeat gets triggered to get the real-time system state. From there, it checks the system state in the registry. If the real-time system state is different from the one in the registry, the registry is updated to the real-time system state. If the system state is on, the system outage is over. For the inventory system, if the system state is off, a new heartbeat scheduler job is added after a heartbeat. For the order system, a new job is always added after a heartbeat. The interval between the heartbeat scheduler jobs is configurable (default is 5 minutes).

Order management system outage and getInventory availability in the product display page and add to shopping cart page

During the process of getting and checking inventory availability, HCL Commerce:
  1. Retrieves the inventory component state from the registry.
  2. If the system state of the inventory component is off, HCL Commerce bypasses the order management system monitorItemAvailability and findInventory API calls, and returns a successful response. The response of the inventory status is decided by the fallback status in the inventory configuration.
  3. If the system state of the inventory component is on, HCL Commerce calls the order management system monitorItemAvailability and findInventory API synchronously through the Service Definition Framework.
    • If an exception, such as TimeoutException or IOException, is received, HCL Commerce calls heartbeat. If the heartbeat returns order management system off, HCL Commerce updates the system state of the inventory component to off in the Registry. It accepts the exception and returns as a successful response. HCL Commerce then adds a scheduler job to run the heartbeat again in a configurable period (example, 5 minutes). This scheduled job adds a scheduler job for the heartbeat until it detects that the order management system is on.

Order management system outage and the reserve inventory process

OrderPrepare is called during the inventory reservation phase. The following actions in HCL Commerce are triggered:
  1. When the shopper goes to the order summary page and OrderPrepare is called: HCL Commerce retrieves the inventory component state from the Registry.
  2. If the system state of inventory component is off, HCL Commerce bypasses the order management system reserveAvailableInventory API call and returns a successful response.
  3. If the system state of inventory component is on, HCL Commerce calls the order management system reserveAvailabileInventory API synchronously through the Service Definition Framework.
    • If an exception, such as TimeoutException or IOException, is received, HCL Commerce calls heartbeat. If the heartbeat returns Inventory system off, HCL Commerce updates the system state of the inventory component to off in the Registry. It accepts the exception and returns as a successful response. HCL Commerce then adds a scheduler job to run the heartbeat again in a configurable period (example, 5 minutes). This scheduled job adds a new scheduler job for the heartbeat until it detects that the order management system is on.
  4. If reserving inventory is run when the order management system is off, depending on the fallback status in the qualified inventory configuration, HCL Commerce updates the inventory status of all items in the order. HCL Commerce updates the status to NALC, if the fallback status is not configured as available or backorderable. HCL Commerce updates the status of the items in the order to VALC, which indicates that the inventory reservation virtually happens.

HCL Commerce cancels inventory reservation and order management system outage

When HCL Commerce cancels an inventory reservation, it triggers this series of events during an order management system outage:
  1. HCL Commerce retrieves the inventory component state from the Registry.
  2. If the system state of inventory component is off, HCL Commerce bypasses the order management system cancelReservation API call and returns a successful response.
    Note: If the inventory reservation expiration rule in order management system is set, HCL Commerce relies on this expiration rule to make the inventory reservation expired in this situation.
  3. If the system state of inventory component is on, HCL Commerce calls the order management system cancelReservation API synchronously through the Service Definition Framework.
    • If an exception, such as TimeoutException or IOException, is received, HCL Commerce calls heartbeat. If the heartbeat returns order management system off, HCL Commerce updates the system state of the inventory component to off in the Registry. It accepts the exception and returns as a successful response. HCL Commerce then adds a scheduler job to run the heartbeat again in a configurable period (example, 5 minutes). This scheduled job adds a scheduler job for the heartbeat until it detects that the order management system is on.

Order transfer and order management system outage

After an order is successfully submitted, and or payment is authorized, HCL Commerce transfers the order. During an order management system outage, it triggers a series of events:
  1. HCL Commerce retrieves the order component state from the Registry.
  2. If the system state of order component is on, HCL Commerce checks the inventory state of the order items. If the order state is VALC, HCL Commerce does not pass the reservation line information to the order management system.
  3. If the system state of order system component is off, HCL Commerce does not trigger the order transfer. The order is then put to H: Failed to Transfer status.
  4. Order transfer is triggered in the asynchronous mode in HCL Commerce, unlike processing in the inventory operations. It is hard for HCL Commerce to detect the system state and transfer the order in the same transaction. Therefore, the heartbeat is running in the regular scheduler mode.

OrderRetransfer for orders in H or F status and order management system outage

HCL Commerce introduces a new scheduler job to transfer orders that are waiting to be transferred to the Sterling Order Management due to the order management system outage.
  1. HCL Commerce retrieves the order component state from the Registry. If the system state is off, it is directly returned.
  2. If the system state of order component is on, HCL Commerce picks up the orders in H: Failed to Transfer status. The order transfer is triggered for these orders, but not to pass line reservation information for VALC order items.
  3. If the system state of order component is on, HCL Commerce picks up the orders in F: Hold on Transfer status that has not been updated for a long time. This time period is configurable. The order information is gathered from Sterling Order Management. If Sterling Order Management does not return the order information, HCL Commerce triggers the order transfer. If Sterling Order Management returns the order information, HCL Commerce updates the order status to G: Successfully Transferred, and does not trigger the order transfer.
Note: Set the OrderRetransfer scheduled job at the Store level within the HCL Commerce Administration Console.