Geeks With Blogs
Nigel Parker BizTalk 2004 Developer - Auckland, New Zealand,

I have been working on a few BizTalk solutions recently that don't have dependencies on SQL or external assemblies. Within these projects I have needed to get access to configuration information such as “process time out value” or “notification email address”. I have found it particularly useful to use the Rules Engine that ships with BizTalk to store such values.

 

Why?

 

  1. The rules engine is installed by default on any machine running BizTalk.
  2. There is no need to modify the “BTSNTSvc.exe.config” to use the rules engine… modifying this file is difficult to do via deployment scripts and if done incorrectly can cause the whole BizTalk service to stop responding.
  3. A small helper class can be written in c# (calling the Microsoft.RuleEngine object) and referenced from build scripts to automatically deploy/ undeploy rules engine policies and vocabularies.
  4. By using vocabularies, config values can be displayed to users who are responsible for maintaining systems in plain English. There is no need for them forage through XML code as required when using .config files.
  5. The rules engine supports full versioning natively… therefore a full history of changes to config values is stored for auditing purposes.

 

So how does it work, check out an end-to-end example I have written that deals with the scenario of receiving a Purchase Order and then checking for duplicate Purchase Orders being received. The sample is available at http://www.gobeyond.net.nz//Files/RulesEngineConfigForBizTalk.zip  (extract all to c:\)

 

I have written the sample using our internal best practices and naming conventions for Biz Talk development.

The sample includes a build script for “auto deployment“

 

To get the sample working you will need to perform the following steps:

  1. Open the solution in Visual Studio.
  2. Change the email address to your email in the  C:\Dev\Intergen.RulesEngineConfigForBizTalk\Intergen.RulesEngineConfigForBizTalk.Configuration.Policy.xml file. You will need to ensure that your SMTP adapter for BizTalk is set up and working.
  3. Build the solution “Right click solution and select Build Solution“.
  4. Ensure that the dll for each project are created in the bin\Debug\ directory and that the Configuration Properties/Deployment/Server value is still showing as (LOCAL) for each BizTalk project.
  5. Select “Deploy BizTalk Solution“ from the Tools menu in Visual Studio. If it's not there follow the instructions to bootstrap NANT to the Visual Studio Tools menu in the appendix below.

To test the sample perform the following steps:

  1. Drop the two files “PO_100.xml“ and “PO_101.xml“ from the “C:\Dev\Intergen.RulesEngineConfigForBizTalk\TEST“ directory into the “C:\Dev\Intergen.RulesEngineConfigForBizTalk\TEST\POIN“ directory.
  2. Drop the file “PO_100_Duplicate.xml” from the “C:\Dev\Intergen.RulesEngineConfigForBizTalk\TEST“ directory into the “C:\Dev\Intergen.RulesEngineConfigForBizTalk\TEST\POIN“ directory.
  3. Check your email for a message reporting on the duplicate purchase orders.

Enjoy… Nigel

 

Appendix A: Bootstrapping NAnt

 

To get started with NAnt, you can follow these steps:

 

1.      Download the latest NAnt (currently 0.84) from http://nant.sourceforge.net and unzip it under C:\Program Files\NAnt.

2.      Download the latest NAntContrib release from http://nantcontrib.sourceforge.net and copy all files in NAntContrib's bin directory into NAnt's bin directory.

3.      In C:\Program Files\NAnt\bin\NAnt.exe.config change the default framework to 1.1:

4.      Create a VS.NET External tool (Tools-External Tools-Add), with:

 

Title: Deploy BizTalk Solution

Command: C:\Program Files\NAnt\bin\NAnt.exe

Arguments: /f:"$(SolutionDir)\$(SolutionFileName).deploy.build" debug.deploy 

Initial Directory: $(SolutionDir)

(You can create a variation for release deployments if you like.)

Turn on the “Use Output Window” checkbox.

 

Posted on Monday, October 25, 2004 5:12 AM Using The Business Rules Engine | Back to top


Comments on this post: Using the Rules Engine for orchestration configuration values *BizTalk Sample*...

# re: Using the Rules Engine for orchestration configuration values *BizTalk Sample*...
Requesting Gravatar...
Hi

This link does not work,
http://www.gobeyond.net.nz//Files/RulesEngineConfigForBizTalk.zip

can you send me the correct link?

Mike.Kolling@etcgs.com
Left by Mike Kolling on Feb 06, 2007 11:07 PM

# re: Using the Rules Engine for orchestration configuration values *BizTalk Sample*...
Requesting Gravatar...
Hi:

Above link doesn't work? ............ where is the working one?

Left by Aliks on Jun 11, 2007 4:46 PM

# re: Using the Rules Engine for orchestration configuration values *BizTalk Sample*...
Requesting Gravatar...
The link doesn't work. Can you please provide the right one.
Left by eliassal on Jan 04, 2010 6:08 AM

Your comment:
 (will show your gravatar)


Copyright © Nigel Parker | Powered by: GeeksWithBlogs.net