Tweak Existing Configuration

Requires v. 1.2.6

The application is configured with two configuration files, which are start.cfg and application.cfg. Generally there will be one of each, which will be quite standard across companies. However, as all warehouses have their special ways of doing things there will most likely be small changes individually for each company. Up till now those changes have been made directly in either configuration file.

For simplicity, functionality has been added to the application where it is able to read multiple configuration files for the same type, e.g. application and start, and combine them into one. This will allow most companies to use the standard files, with the special functionality extracted into separate files, making it easy to update the standard functionality, and keeping custom behaviour.

This gives a brief explanation and examples of how to use the tweak functionality of configuration files. The same mechanism applies to both start and application configuration files.

*NOTE: When using the schema validation in VS Code the tweak attributes are marked as being an error.

Filename conventions

To enable this functionality the file with the custom behaviour needs to adhere to the following format, and be located next to the standard files in the configuration folder.

application-<custom-name-here>.cfg start-<custom-name-here>.cfg

Examples follow below.

How it works

Tweaks are applied to sections of the configuration by adding the tweak attribute to a configuration element, e.g. a <page>, <images> or <listConfiguration> element.

Examples

Replacing all pages

We have our application.cfg file with the following content (stripped down for illustrative purposes):

<?xml version="1.0" encoding="utf-8"?> <application xmlns="http://schemas.taskletfactory.com/MobileWMS/Application"> <!-- PAGES --> <pages> <page id="lookup" type="Lookup" icon="icon" /> <page id="orders" type="OrderList" icon="icon" /> <page id="lines" type="OrderLines" icon="icon" /> </pages> </application>

We want to replace all pages in that configuration with a fresh batch. This can be achieved by adding the tweak="replace" attribute on the <pages> element in a tweak file.

Content of application-replace-pages.cfg:

<?xml version="1.0" encoding="utf-8"?> <application xmlns="http://schemas.taskletfactory.com/MobileWMS/Application"> <pages tweak="replace"> <page id="all-alone" type="Lookup" icon="icon" /> </pages> </application>

Add an extra page

We use the same application.cfg from the previous example, containing three pages. In this example we would like to add an extra page and create a tweak file application-add-page.cfg with the following content:

Notice how the tweak="append" attribute is added to the <pages> element.

Change list configuration for a specific page

In the configuration example below, the PutAway page uses the standard list configuration Orders.

We want to use a different list configuration that is tailored to our needs. This can be achieved with a tweak file a la the one below, e.g. named application-our-putaway-list-configuration.cfg:

This tweak uses the tweak="append" to add a new list configuration and then the tweak="replace" attribute in the page section to override the existing configuration.