We can use the rules engine to store parameters that can be accessed from orchestrations.
To add parameters that can be accessed from an orchestration, there are two basic steps:
- To create the parameters in a vocabulary in the rules engine and save them.
a. Open the Microsoft Business Rule Composer.
b. Add the new vocabulary.

2. To add .NET code to a BizTalk Helper class to access the vocabulary through the rules engine API.
a. We can use the following code based and corrected of the code available at: http://www.apress.com/ApressCorporate/supplement/1/10137/1590597117-3814.pdf
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.RuleEngine;
using System.Collections;
namespace LibraryBizTalk
{
public class LibraryBizTalkClass
{
private LibraryBizTalkClass() {}
public static bool GetVocabularyConstantValue(
string strVocabularyName,
string strConstantName,
string strVersion,
ref string strConstantValue,
ref string strConstantType)
{
RuleStore rlsRuleStore;
VocabularyInfoCollection vicVocabInfo;
Vocabulary vocVocab;
RuleSetDeploymentDriver rsdDriver = new RuleSetDeploymentDriver();
LiteralDefinition litDef;
Boolean blnConstantFound = false;
rlsRuleStore = rsdDriver.GetRuleStore();
if (String.IsNullOrEmpty(strVersion))
{
vicVocabInfo = rlsRuleStore.GetVocabularies(strVocabularyName,
RuleStore.Filter.Latest);
}
else
{
vicVocabInfo = rlsRuleStore.GetVocabularies(strVocabularyName,
RuleStore.Filter.All);
}
// check to see that the vocabulary searched on has returned data
if (vicVocabInfo.Count > 0)
{
for (int x = 0; x < vicVocabInfo.Count; x++)
{
vocVocab = rlsRuleStore.GetVocabulary(vicVocabInfo[x]);
// Check to see that the version equals the version being
// searched for or that the version passed in was a
// wildcard (Null)
if (String.IsNullOrEmpty(strVersion) ||
((vocVocab.CurrentVersion.MajorRevision + "." +
vocVocab.CurrentVersion.MinorRevision) == strVersion))
{
// check that the constant being searched for exists
// in the vocabulary
if (vocVocab.Definitions.ContainsName(strConstantName))
{
litDef = (LiteralDefinition)
vocVocab.Definitions.GetByName(strConstantName);
strConstantType = litDef.Value.GetType().ToString();
strConstantValue = litDef.Value.ToString();
blnConstantFound = true;
// exit loop
break;
}
}
}
}
return blnConstantFound;
}
}
}
b. You can use the following code to invoke the previuos class from an orchestration Expresion shape.
strType = "string";
// the following string is the name of the vocabulary
strVocabularyName = "Configuracion";
LibraryBizTalk.LibraryBizTalkClass.GetVocabularyConstantValue(strVocabularyName, "ValPar1", "",ref strValue,ref strType);
At the following links you have other alternatives to the BizTalk configuration:
Note: SSO can be your better option.
http://geekswithblogs.net/gwiele/archive/2004/11/17/15168.aspx (The BizTalk Configuration Dilemma)
http://www.masteringbiztalk.com/blogs/jon/PermaLink,guid,6e4b84db-d15f-45e9-b245-08b1eb6c4def.aspx (How to store configuration data in the Enterprise Single Sign-On Database (SSO))
http://biztalkblogs.com/nishil/archive/2006/11/28/1534.aspx (Storing Usernames, Passwords in SSODB Database using MMC 3.0 )
http://seroter.wordpress.com/2007/09/21/biztalk-sso-configuration-data-storage-tool/ (Utility to lower the barrier of entry for SSO)
http://geekswithblogs.net/michaelstephenson/archive/2008/05/25/122381.aspx (Where do I store my custom configuration for a BizTalk solution)
Regards,
Francisco Ruiz