Using the 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>]
NOTE: 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> Note: Optional
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.
To use the bomLoad command
1 Open a Windows command window.
2 cd to <aPriori Install folder>\bin
3 Enter:
bomLoad <full path to the bomLoad.properties file>
The above example assumes that you are providing <username> and <password> through the properties file. The bomLoad.properties file must have all the required properties specified. Assuming that all supplied properties are valid, all data from the BOM csv file will be pushed to the aPriori database and the corresponding scenario files will be created or updated. The following info will appear in the console:
Between the lines BEGIN BOM LOAD and END BOM LOAD lines are four sections:
Inputs -- Contains some of the specified properties in the bomLoad.properties file (follows the same order as the BOM Load UI).
Mapping – Lists the fields for the specified mapping.
Validating – Records the progress of each data row import.
Import results – Displays totals (similar in appearance to the BOM load UI).
If any of the required properties are not specified, an error message with the missing property name(s) is displayed in the console. An example of output for a missing defaultScenarioName property is shown below:
Other messages are displayed for errors such as specifying non-existing mappings or failing to supply a rollupName property for a functional group template.
The following screenshot shows an example of the error log file:
<user home>\aPriori\minorVersion\bomLoad-logs\apriori.log