Sample: Loading non-ATP inventory

This scenario loads inventory records for a non-ATP store. You can either load the data into a B2C store, or an extended sites store.

About this sample

Each record stands for an inventory for a particular CatalogEntry be shipped from a FulfillmentCenter on behalf of a Store. The CatalogEntry can be identified by the PartNumber In non_ATP_inventory.csv and storeIdentifier in wc-dataload-env.xml For non-ATP store, we only load inventory for item data, it doesn't make sense to load inventory for product data.

Procedure

  1. HCL Commerce DeveloperOn a command line, go to the WCDE_installdir\bin directory.
  2. LinuxOpen a command line in the . Change the directory to utilities_root/bin directory. For information about entering and leaving containers, see Running utilities from the Utility server Docker container.
  3. Enter the appropriate command:
    1. B2C or B2B store
      • Linux./dataload.sh ../samples/DataLoad/Inventory/Non-ATP/wc-dataload.xml
      • HCL Commerce Developerdataload ../samples/DataLoad/Inventory/Non-ATP/wc-dataload.xml
    2. Extended sites store
      • Linux./dataload.sh ../samples/DataLoad/Inventory/Non-ATP/wc-dataload-for-esite.xml
      • HCL Commerce Developerdataload ../samples/DataLoad/Inventory/Non-ATP/wc-dataload-for-esite.xml
HCL Commerce Version 9.1.13.0 or later

Inventory flags

INVENTORYFLAGS in the Inventory table indicates the uses of QUANTITY. It has the following values:
Table 1. Inventory Flags
Value Description
0

This is the default value for INVENTORYFLAGS, and it does not put any additional condition related to QUANTITY.

Placing an order with less than 1 actual QUANTITY and INVENTORYFLAGS value of 0 is not possible.

1

This value indicates noUpdate. The default UpdateInventory task command does not update QUANTITY. Fetching non-ATP inventory availability for Catalog entry with INVENTORYFLAGS value 1 will return the actual QUANTITY value. Any value of QUANTITY lower than 1 will return 0.

Placing an order with less than 1 actual QUANTITY and INVENTORYFLAGS value 1 is not possible.

2

This value indicates noCheck. The default CheckInventory and UpdateInventory task commands do not check QUANTITY. Fetching non-ATP inventory availability for Catalog entry with INVENTORYFLAGS value 2 will always return QUANTITY 1.

Order can be placed when actual QUANTITY is less than 1, and INVENTORYFLAGS value is 2 because there is no check on QUANTITY.

In the com.ibm.commerce.inventory/wc-admin-component.xml file, the ActualAvailableQuantity property is marked enabled below the config group. Update the property value to true. Updating the value gets the available QUANTITY while fetching non-ATP inventory availability with INVENTORYFLAGS value 2. Any value lower than 1 QUANTITY will return 1. This property is false by default.

4

This value indicates actualQuantity. The default CheckInventory and UpdateInventory task commands do not check QUANTITY. Fetching non-ATP inventory availability for Catalog entry with INVENTORYFLAGS value 4 will return actual QUANTITY. Any value of QUANTITY lower than 1 will return 1.

Order can be placed when actual QUANTITY is less than 1, and INVENTORYFLAGS value is 4 because there is no check on QUANTITY.

Loading data for inventory flags

You cannot use the Data Load utility to update the value of INVENTORYFLAGS. The default value of INVENTORYFLAGS is 0. Update it directly using the following SQL statement after the data has been loaded:
 update inventory set inventoryflags=xx where CATENTRY_ID in 
           (SELECT CATENTRY_ID
                      FROM CATENTRY 
                      WHERE partnumber like 'Cords%'
                              or partnumber like 'Classic pleated dress pant%'
                              or partnumber like 'Dress shirt%'
                              or partnumber like 'Casual shirt%'
                              or partnumber like 'Bodysuit%');

Verifying the results

Verify that the data has been loaded by running the following SQL statement:

select * from INVENTORY where CATENTRY_ID in 
           (SELECT CATENTRY_ID
                      FROM CATENTRY 
                      WHERE partnumber like 'Cords%'
                              or partnumber like 'Classic pleated dress pant%'
                              or partnumber like 'Dress shirt%'
                              or partnumber like 'Casual shirt%'
                              or partnumber like 'Bodysuit%');
If you want to update after initial load, you can update in the CSV file and run the load again.

Cleaning up the data

To clean up the data loaded in the database, run the following SQL statement
delete from INVENTORY where CATENTRY_ID in 
           (SELECT CATENTRY_ID
                      FROM CATENTRY 
                      WHERE partnumber like 'Cords%'
                              or partnumber like 'Classic pleated dress pant%'
                              or partnumber like 'Dress shirt%'
                              or partnumber like 'Casual shirt%'
                              or partnumber like 'Bodysuit%');
: