Database Connection String Replacement

Official translation unavailable. Translate this page with Google:

Configuration file for Automation Service can include database connection string replacement commands.

You can configure the service to replace certain parts of a connection string while the trigger is running. This enables a single instance of Automation to run the same configuration, but actually use a different database server for database related functionality. This allows the user to configure triggers in development environments and run them in production environment without any changes in the configuration.

Connection string replacement logic is defined in the DatabaseConnections.Config file that is located in the Automation system folder.

%PROGRAMDATA%\NiceLabel\NiceLabel 10

Configuration file defines from-to pairs using its XML structure. The <Replacement> element contains one <From> and one <To> element. During trigger execution, the "from" string is replaced with the "to" string. You can define as many <Replacement> elements as necessary.

Configuration file is not installed along with Automation. You can add it yourself using structure from the example below. The same search & replace rules are applied to all triggers running in the Automation Service on this machine.

To enable connection string replacement, you must also edit your product.config file that is located in %PROGRAMDATA%\NiceLabel\NiceLabel 10. Add the element /Common/General/UseLocalReplacementStrings and assign value True:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <Common>
        <General>
        ...
            <UseLocalReplacementStrings>True</UseLocalReplacementStrings>
        </General>
    </Common>
...
</configuration>

Note

Make sure you restart both Automation services after adding or editing the config files.