This discussion is archived
6 Replies Latest reply: Jul 15, 2013 7:51 AM by Nitin Khare RSS

Inventory System in ATG

PrincessPoonam Newbie
Currently Being Moderated

Hi All,

 

I wanted to know how the inventory system is handled retailers who have taken ATG for online sales.

 

I placed an order with item A with qty 10, whose inventory status was 100 before purchase. Now the inventory has to be reduced to 90. how will the whole thing work???

 

1. Should the inventory system be an external 3rd party system. Can you give example of this 3rd party example. 

2.Will ATG maintain an Inventory ???

3. How will ATG intimate the 3rd party system, webservice/JMS or what is used to do this???

 

 

Regards

  • 1. Re: Inventory System in ATG
    Nitin Khare Expert
    Currently Being Moderated

    ATG uses an /atg/commerce/inventory/InventoryManager component whose class must implement atg.commerce.inventory.InventoryManager interface. This interface has various methods to query, set, increase, decrease, preorder and backorder stock levels, query and set availability status, notify through JMS on inventory changes. OOTB InventoryManager component uses RepositoryInventoryManager class which implements InventoryManager interface using the default InventoryRepository.

     

    Now a lot depends on the overall design which would dictate whether inventory is stored in the default InventoryRepository or custom repository or in an external system. Inventory can be managed on external systems like SAP, Siebel, Oracle Retail (Store Inventory Management) etc. In some cases order management and warehouse management systems can also provide inventory management.

     

    If you are using external inventory systems then you typically would write your own InventoryManager implementation so that you can query and modify inventory on the external systems using web-services they might expose for the various inventory operations. Based on your requirements and design you can either provide the complete implementation for InventoryManager implementation or can extend AbstractInventoryManagerImpl class overriding purchase() method and any of other ones as required.

  • 2. Re: Inventory System in ATG
    990600 Newbie
    Currently Being Moderated

    @Nitin

     

    In realtime how will this inventory update happen with the inventory systems like Siebe/SIM.??? If they use webservice, for every order placed the web-service is called and the inventory is updated in the inventory systems.????

    When is JMS used and when is webservices used????

  • 3. Re: Inventory System in ATG
    Nitin Khare Expert
    Currently Being Moderated

    @990600

     

     

    There may be different approaches based on the requirements, system design and fulfillment strategies. This can include one or combination of things like OOTB inventory repository, custom repository, inventory feeds, web-services, adding custom message source and sink in patchbay to integrate with other systems etc.

     

    Taking an example Oracle Retail Store Inventory Management (ORSIM) for real-time inventory lookup where the online store want to request inventory details of an item SKU at stores from ORSIM. For this you can implement a new Store Inventory Manager component which can connect to the ORSIM Web service endpoints and exposes an interface allowing store pages to show the inventory. In case inventory information displayed to customers need not be updated in real time you can use CachingInventoryManager which uses InventoryCache and can improve the site performance. Real time inventory information is usually needed only during the purchase process and fulfillment process. There is one InventoryDroplet also provided in form of component /atg/commerce/inventory/InventoryLookup which provide cached data and accesses real time inventory data from the repository as appropriate. It has a useCache parameter allowing you to indicate when to use cached inventory data.

     

    Now coming to the JMS which by nature promotes loose coupling and asynchronous communication. In ATG's own inventory system if any of the inventory levels like stocklevel, backorderLevel and preorderLevel falls below its associated threshold then a JMS event is generated. The JMS message is generated by RepositoryInventoryManager. By default the InventoryManager can create JMS messages for these events: InventoryThresholdReached and UpdateInventory each of which contains various details associated with that event. And if your requirements are not fulfilled by what is already provided you can add your own custom message on dynamo messaging (patchbay) and fire them with your own InventoryManager implementation. And how these JMS messages are handled would depend on the listeners that you implement for these JMS messages. You can add a message sink for these events and take appropriate actions as may be required based on the message like calling web-service, sending email etc.

     

     

    JMS can also come into picture if you are maintaining the inventory data in ATG repository and want to keep it up-to-date with any changes in the master inventory system. You subscribe to subscribes to a TOPIC or listens to a provided QUEUE where the master system might be triggering or placing its messages on inventory updates.

     

    Hope it answers your query.

  • 4. Re: Inventory System in ATG
    Onhate Explorer
    Currently Being Moderated

    Hello!

     

    1. Should the inventory system be an external 3rd party system. Can you give example of this 3rd party example.

    Yes. Follows below some example code.

     

    2.Will ATG maintain an Inventory ???

    Yes, if you implement the right methods.

     

    3. How will ATG intimate the 3rd party system, webservice/JMS or what is used to do this???

    Follows below.

     

    All you need to do is to implements InventoryManager interface and replace on InventoryManager component to use your custom class, there are some interface for ATG JMS system, like, notify when an item returns to stock and other things that you can check here.

     

    Oracle ATG Web Commerce - Inventory Framework

         Oracle ATG Web Commerce - Building a New InventoryManager

     

     

    import javax.jms.JMSException;
    import javax.jms.Message;
    import atg.commerce.inventory.AbstractInventoryManagerImpl;
    import atg.commerce.inventory.InventoryException;
    import atg.dms.patchbay.MessageSink;
    import atg.dms.patchbay.MessageSource;
    import atg.dms.patchbay.MessageSourceContext;
    public class OnlineInventoryManager extends AbstractInventoryManagerImpl implements MessageSource, MessageSink {
      protected MessageSourceContext messageSourceContext;
      protected boolean allowMessageSending;
      @Override
      public String getInventoryName() {
      return getClass().getName();
      }
      @Override
      public int purchase(String pid, long howMany) throws InventoryException {
      // :TODO - call webservice/service to decrease the inventory
      return 0;
      }
      @Override
      public int purchase(String pid, long howMany, String locId)
      throws InventoryException {
      return purchase(pid, howMany);
      }
      @Override
      public int queryAvailabilityStatus(String pId) throws InventoryException {
      long stockLevel = queryStockLevel(pId);
      return (stockLevel > 0) ? AVAILABILITY_STATUS_IN_STOCK : AVAILABILITY_STATUS_OUT_OF_STOCK;
      }
      @Override
      public long queryStockLevel(String pId) throws InventoryException {
      // :TODO - call webservice/service to return the inventory for this pId (SKU)
      return new Random().nextLong();
      }
      @Override
      public void setMessageSourceContext(
      MessageSourceContext messageSourceContext) {
      this.messageSourceContext = messageSourceContext;
      }
      public MessageSourceContext getMessageSourceContext() {
      return this.messageSourceContext;
      }
      @Override
      public void startMessageSource() {
      if (isLoggingDebug())
      logDebug("You can now start sending messages");
      this.allowMessageSending = true;
      }
      @Override
      public void stopMessageSource() {
      this.allowMessageSending = false;
      }
      @Override
      public void receiveMessage(String pPortName, Message pMessage)
      throws JMSException {
      }
    }
  • 5. Re: Inventory System in ATG
    990600 Newbie
    Currently Being Moderated

    @Nitin

    Thanks for your reply.


    Oracle Retail Store Inventory Management (ORSIM) and ATG:


      In real time is ORSIM is used/integrated with ATG for Inventory check alone.Was keen on knowing what is the input data that goes from ATG to ORSIM and wat is the data that flows back from ORSIM back to ATG.

  • 6. Re: Inventory System in ATG
    Nitin Khare Expert
    Currently Being Moderated

    In real time is ORSIM is used/integrated with ATG for Inventory check alone.Was keen on knowing what is the input data that goes from ATG to ORSIM and wat is the data that flows back from ORSIM back to ATG.

    @990600

    Not sure about an exact answer to the data flows back-and-forth between ORSIM and ATG as it would depend on the overall system. There can be many things but here are few things that are off the top of my head: inventory lookups and passing the information to ATG and other channels, reserving inventories for the customer orders, handling in-store pickups, multiple deliveries for same day, return cases etc. Hope it helps.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points