Skip to content

BOM loader from the command line

The BOM Loader provides a command line option which enables you to automate your BOM import into aPriori using a task scheduler. This is implemented in a batch file command named bomLoad that takes as an argument a configuration file specifying what the BOM load run will do. This behaves exactly as if you had provided the same inputs to the BOM loader UI and clicked Import.

The template properties file and bomload.cmd file are stored in:

<aPriori_Install_dir>\bin\bomLoad.cmd
<aPriori_Install_dir>\ext\bom-cost-loader-plugin\command-line\bomLoadTemplate.properties

The bomLoad command has the following syntax:

bomLoad <propertiesFile> [<username> <password>]

If <username> and <password> are not specified on the command line, they are searched for in the properties file. If not found there, and if your aPriori administrator has implemented Single Sign On (SSO), the BOM loader attempts to use the currently logged-in user’s Windows credentials.

The following properties can be specified in <propertiesFile>:

bomLoad.username=<username>
bomLoad.password=<password>
bomLoad.deployment =<deployment>
bomLoad.schemaname=<schemaname>
bomLoad.bomCsvFile=<pathToBOMCsvFile>
bomLoad.mapping=<mapping> //Note: The specified mapping must exist in the database.
bomLoad.defaultScenarioName=<defaultScenarioName>
bomLoad.defaultScenarioProcessingRule=<create|update|skip>
bomLoad.rollupName=<rollupName> //Note: Optional
bomLoad.functionalGroupTemplate=<functionalGroupTemplate> 

You can configure the bomLoad.cmd script to set custom values for max heap size and max perm size by following commented instructions in the script.

To use the default settings, leave the script as is. It should look like this:

::@call "%~dp0runAnt.cmd" -f "%ANT_SCRIPTS%/bomLoad.xml" 
"-Dapriori.propertiesFile=%PROPERTIES_FILE%" "-Dapriori.user=%USER%" 
"-Dapriori.password=%PASSWORD%" bomLoad
// comment line above and uncomment lines below to override max heap/perm size. 
//1020m and 150m are example values, change these to the desired memory sizes
::@set MAX_HEAP_SIZE=1020m
::@set MAX_PERM_SIZE=150m
::@call "%~dp0runAnt.cmd" -f "%ANT_SCRIPTS%/bomLoad.xml" 
"-Dapriori.maxMemory=%MAX_HEAP_SIZE%" 
"-Dapriori.maxPermSize=%MAX_PERM_SIZE%" 
"-Dapriori.propertiesFile=%PROPERTIES_FILE%" 
"-Dapriori.user=%USER%" "-Dapriori.password=%PASSWORD%" bomLoad
//To use custom values, comment out the first @call line 
//and uncomment the remaining lines under the instructions comment. 
//It should look like this:
::@call "%~dp0runAnt.cmd" -f "%ANT_SCRIPTS%/bomLoad.xml" 
"-Dapriori.propertiesFile=%PROPERTIES_FILE%" "-Dapriori.user=%USER%" 
"-Dapriori.password=%PASSWORD%" bomLoad
:: //comment line above and uncomment lines below to 
//override max heap/perm size.
//1020m and 150m are example values, change 
//these to the desired memory sizes
@set MAX_HEAP_SIZE=1020m
@set MAX_PERM_SIZE=150m
@call "%~dp0runAnt.cmd" -f "%ANT_SCRIPTS%/bomLoad.xml" 
"-Dapriori.maxMemory=%MAX_HEAP_SIZE%" 
"-Dapriori.maxPermSize=%MAX_PERM_SIZE%" 
"-Dapriori.propertiesFile=%PROPERTIES_FILE%" "-Dapriori.user=%USER%" 
"-Dapriori.password=%PASSWORD%" bomLoad

Note:

“1020m” and “150m” are example values, these should be set to the desired sizes.

All errors, status indications, and results of the import will be output to the console and to log files.

Log files are saved in <user home>``\aPriori\minorVersion\bomLoad-logs

Java exceptions are output to the log file only.