There are a couple of options a developer can have when comes to using configurable values. These options can be divided into two categories:
This article will provide guidance on each of possible options.
The BizTalk orchestration engine uses an XML file called BTSNTSvc.exe.config to determine certain behaviors. This file attaches to the main executable BTSNTSvc.exe. Any changes placed in BTSNTSvc.exe.config apply to all host instance regardless of their names. This file is always located in the same directory as the BTSNTSvc.exe file, which is usually C:\Program Files\Microsoft BizTalk Server 2010. Any changes in this file will result in a restart of BizTalk Host Instance. Values can be obtained through code in expression shape in an orchestration.
A custom configuration file (.config) can be option to store configuration data that you can use within BizTalk orchestration for instance. A custom config can be easier to maintain that BTSNTSvc.exe.config file.You can choose whether or not to use Enterprise Library or custom code. Enterprise Library may be too much overhead to just access a custom file. Accessing a .config file can be done using simple .NET code, using the System.Configuration namespace.
Another option is accessing the registry to obtain configuration values. Through custom code in .NET Helper Class using Microsoft.Win32 namespace you can access the registry and read values. See code below to access the registry.
So far registry and file options have been discussed. Not the best options when you want to consider a central store for your custom configuration data. A database would be a better option from an administrative viewpoint. Business Rule Engine (BRE) can be used to store configuration data. Using a vocabulary with custom definitions containing constant values. Code below shows how to access custom definition in a vocabulary.
One of popular and easy options of retrieving configuration data is using SSO. Microsoft has built a SSO Application Configuration snap in that provides an good user experience maintaining custom configuration data. When downloading the snap in you will also get code for a .NET Helper Class to support retrieval of data in BizTalk. See code below for retrieving data from SSO.
Content to be added.
There are a couple of samples available demonstrating the options: