di-calculateprice utility
The di-calculateprice utility updates the information in the price index based on the pricing model your store uses. For example, for a B2B starter store, the price index is built to display contract prices in the storefront.
Parameter values
- instance
- The name of the WebSphere Commerce instance with which you are working (for example, demo).
- serverName
- The fully qualified host name of your WebSphere Commerce Server (for example, wcserver.mydomain.ibm.com is fully qualified).
- masterCatalogId
- Required: The ID of the master catalog (for example, 10101).If you do not know the master catalog ID, run the following SQL:
SQL: select * from catalog where IDENTIFIER='STORE_IDENTIFIER'
To find the master catalog ID for an Extended Site store:- Find the store
ID:
select * from storeent where IDENTIFIER='STORE_IDENTIFIER'
- Use the storeent_id as the store_id in the following
SQL to find the catalog asset store ID of this Extended Site
store:
Where XXXXXX is the storeent_id from the SQL in step 1 when building the search index.select * from storerel where store_id=XXXXXX and streltyp_id=-4 and relatedstore_id not in (XXXXXX)
- Get the master catalog
ID:
Where YYYYYY is the relatedstore_id from step 2 when building the search index.select * from storecat where storeent_id=YYYYYY and mastercatalog='1'
- Find the store
ID:
- siteAdminId
- The user ID of the site administrator. The utility is run under the authority of this user.
- siteAdminPwd
- Optional: The password of the site administrator. You are prompted for the password if not passed in.
- passwordFile
- Optional: The full path to the password.properties file that contains the site administrator password. For example, C:\password.properties.
- trading
- Optional: Used to build prices for the specified contract IDs.
- currency
- Optional: Used to build prices for the specified currencies.
- catentry
- Optional: Used to build prices for the specified catalog entries.
- numWorkers
- Optional: This parameter defines the number of calculators. The total number of products that are assigned to one calculator is arrived by dividing the number of products by the number of calculators. In every calculator, the assigned catentries are calculated against all valid buyer contracts that are deployed by the sharing stores of the specified master catalog and all valid currencies that are supported by the sharing stores. For large catalog size, it is recommended to define larger numWorkers to decrease the total execution time of a thread. In addition, the running thread is defined by workManager maximum number, therefore when the numWorkers are larger than work manager number, other numWorkers must wait in queue to be run.
- flushSize
- Optional: This parameter defines the number of batch statements that flush into database. With large flushSize, the database might roll back. With small flushSize, the database might have to be committed multiple times.
Example
From the following directory:
- WC_installdir/bin
- WCDE_installdir\bin
di-calculateprice.bat -instance instance_name -serverName host_name -masterCatalogId masterCatalogId -siteAdminId siteAdminId [-siteAdminPwd siteAdminPwd] [-passwordFile passwordFile] [-trading trading] [-currency currency] [-catentry catentry] [-numWorkers numWorkers] [-flushSize flushSize]
di-calculateprice.sh -instance instance_name -serverName serverName -masterCatalogId masterCatalogId -siteAdminId siteAdminId [-siteAdminPwd siteAdminPwd] [-passwordFile passwordFile] [-trading trading] [-currency currency] [-catentry catentry] [-numWorkers numWorkers] [-flushSize flushSize]
di-calculateprice.bat -instance instance_name -serverName serverName -masterCatalogId masterCatalogId -siteAdminId siteAdminId [-siteAdminPwd siteAdminPwd] [-passwordFile passwordFile] [-trading trading] [-currency currency] [-catentry catentry] [-numWorkers numWorkers] [-flushSize flushSize]
Ensure that the utility runs successfully.
If the utility runs successfully, the following message
is displayed in the Command
window:
The program exiting with exit code: 0. Price calculation process completed successfully with no errors.Also, inspect the following file for errors:
- WC_installdir/logs/wc-dataimport-calculateprice.log
- WCDE_installdir\logs\wc-dataimport-calculateprice.log
To get more logging information, update the logging level from
INFO
to FINEST
in the
WC_installdir/instances/instance_name/xml/config/dataimport/calculateprice-logging.properties
file:# Default global logging level, INFO
com.ibm.commerce.level=FINEST
You
can also increase the log file size and the number of log files. For
example:
# Limiting size of output file in bytes:
java.util.logging.FileHandler.limit=50000000
# Number of output files to cycle through
java.util.logging.FileHandler.count=2
If
the utility fails due to a transaction timeout error, increase the transaction timeout time to a
higher value.