Sample: Order Justification

This sample demonstrates how to add return justifications to order appeasement in the HCL Commerce database using the data load utility.

About this sample

This sample loads a sample justification and its descriptions into ORDJUST and ORDJUSTDESC database tables. Return justifications can be used when a Customer Service Representative (CSR) files an order return or requests appeasement for an order.

You can load this sample information in both CSV or XML formatted input files. However, the following procedure only loads CSV input files. If you prefer to work with the data from the XML files, you can edit the sample configuration files accordingly. The sample input files are located within the following directory:
  • Linuxutilities_root/samples/DataLoad/Order/Justification
  • HCL Commerce DeveloperWCDE_installdir\samples\DataLoad\Order\Justification

Sample input and configuration files

The following table lists the input source files used for loading order justification. The table also lists the business object mediators and business object configuration files that the Data Load utility uses to load the order justification.

Sample input file Description
CSV
  • OrderJustification.csv
  • OrderJustificationDescription.csv
XML
  • OrderJustification.xml
  • OrderJustificationDescription.xml
The Data Load utility uses these sample input files to load the order justification and descriptions. The order justification is loaded first, and then the description.

The Data Load utility uses the table object mediator and the following business object configuration files to load the data within this input file:

Business object mediator

com.ibm.commerce.foundation.businessobjectmediator.TableObjectMediator

Business object configuration file
  • Linuxutilities_root/samples/DataLoad/Order/Justification/wc-loader-order-justification.xml
  • Linuxutilities_root/samples/DataLoad/Order/Justification/wc-loader-order-justification-description.xml
  • HCL Commerce DeveloperWCDE_installdir\samples\DataLoad\Order\Justification\wc-loader-order-justification.xml
  • HCL Commerce DeveloperWCDE_installdir\samples\DataLoad\Order\Justification\wc-loader-order-justification-description.xml

For more information about the table object mediator, see Data Load utility table-based mediator and builder.

Procedure

  1. In a file manager, go to the following directory:
    • Linuxutilities_root/samples/DataLoad/Order/Justification
    • HCL Commerce DeveloperWCDE_installdir\samples\DataLoad\Order\Justification
  2. Open the wc-dataload-env.xml data load environment configuration file for editing. Update the file to set the environment settings within the file to match your environment setting. For more information about this configuration file, see Configuring the data load environment settings.
  3. HCL Commerce Developer On a command line, go to the WCDE_installdir\bin directory.
  4. Linux Open a command line and change the directory to the utilities_root/bin. For more information about entering and leaving containers, see Running utilities from the Utility server Docker container.
  5. Enter the following command to run the sample data load order file for loading store configuration information:
    • Linux./dataload.sh ../samples/DataLoad/Order/Justification/wc-dataload-order-justification.xml
    • HCL Commerce Developerdataload ..\samples\DataLoad\Order\Justification\wc-dataload-order-justification.xml
    The load order configuration file identifies the order that the Data Load utility loads the sample CSV files. The load order file also identifies the appropriate business object configuration file to use to load each input file. For more information about load order configuration files, see Configuring the data load order.

    For more information about configuring and running the Data Load utility, see Configuring and running the Data Load utility.

Verifying results

Ensure that the sample order justification is correctly loaded by reviewing the data load summary report. For more information about the location and contents of this summary report, see Verifying the results of the data load.

You can also verify that the sample data is loaded by running the following SQL statements against your HCL Commerce database:
select * from ORDJUST;
select * from ORDJUSTDESC;
Ensure that the data within the sample input files exists within the database table for the appropriate store.

Removing the sample data from the HCL Commerce database

To remove the sample data from your database, run the sample again but with the value for the delete column set to 1 for all entries within the files. By setting the value for this column to 1, the Data Load utility deletes the data identified in the CSV file from your database.

When an order justification is deleted in the ORDJUST table, all related descriptions in the ORDJUSTDESC table will also be cascading deleted. Ensure the corresponding data in the order justification description input file is not included when deleting the order justification.

Note: Set the MarkForDelete column to 1 for order justification load. This action will mark the entry as deleted, but it does not physically delete the record. This functionality is primarily utilized in CSR tooling to hide the justification from display, without affecting the existing appeasement or return relationship.