Database Update Wizard

DUW Scripts: Best Practices

Best Practices for DUW Scripts

Note: Languages should be disabled in \WEB-INF\config\context\compatibility\afm-config.xml if there is the possibility of outdated enumeration list translations as any step in the update scripts.

Checking a DUW Script

Before executing a script with the Database Update Wizard, you may wish to check it for syntax errors using the Validate option, which runs: ${check.script(<file.duw>)};.

This command validates the indicated script (including nested scripts) for any possible errors that can occur during the real execution of the script. The command checks your scripts; it does not execute any commands.

From the Database Update Wizard, select that you want to update by running a script. On the Run Script screen, select the Validate Schema option. A checkmark next to this option indicates that the schema is valid.

The command detects the following errors:

Error or Warning Description

Wrong path

File not found

Detected in ${run.script} and ${import.file} if they reference a non-existent path or file.
Zero file size Detected in ${run.script} and ${import.file} if they refer to an empty file.
Unsupported macro Detects if you have a typo, or if you used a non-existent macro such as ${transfer.file}.
Unsupported data transfer mode Archibus supports only UPDATE/INSERT as a second parameter in ${import.file} command.
Empty commands (warning) Indicates if you have specified an empty SQL command.

Best Practices for Folders

Master Folder

The master folder is the path for the script files in \webcentral-war-root\src\main\webapp\projects\users\public\dt\xx.x.xxx where xx.x.xxx is defined as <Major version>.<Minor version>.<Patch number>

Each master folder should contain three files:

Each master folder should contain two folders:

The sample-data folder structure should contain:

${run.script('%publicDataTransferDirectory%\23.2-plus\sample-data\app-bldgops\common\update-sample-data.duw')};
${run.script('%publicDataTransferDirectory%\23.2-plus\sample-data\app-bldgops\business-value-scripts\update-sample-data.duw')};

The same applies to the schema folder, but applicable for the update-schema.duw file.

Schema Folder

Changes to the following tables belongs to the schema folder:

Category Description
Data Dictionary afm_tbls, afm_flds, afm_flds_lang
Navigator afm_ptasks, afm_subtasks, afm_actprods, afm_activities, afm_psubtasks, afm_products, afm_processes, afm_activity_cats, afm_tasks
Application Dictionary messages, afm_scmpref, afm_dwgpub, afm_layr, afm_wf_rules, afm_bim_families, afm_bim_categories, afm_atyp, afm_activity_params
Project Data all tables that do not fall in the categories above. We aim that these are the tables to customize. 

Sample Data Folder

Changes that do not fall into categories above belongs to the sample-data, if not stated otherwise.

See Also

Database Update Wizard Overview