The BizTalk BRE Pipeline Framework provides increased flexibility in development and maintenance of pipeline components by leveraging the Business Rules Engine.
Note that this framework currently only works with BizTalk Server 2010.
The BRE Pipeline Framework Codeplex project can always use more contributors. If you'd like to contribute in any of these facilities or in any other way then send me a private message on my codeplex account jcooper1982, and I will be sure to credit
you for your work.
The design goals of the BRE Pipeline Framework are as below
-Reduce the amount of time required to introduce new logic into a BizTalk pipeline. Instead concentrate on capturing logic in reusable class libraries.
-Reduce the complexities surrounding the deployment of pipeline components. Since logic is held in business rules and class libraries which the pipeline component doesn't have any direct references to, the pipeline component will not need to be redeployed
unless there are changes to the pipeline component itself (plumbing rather than logic).
-Promote the reuse of logic used within BizTalk pipelines rather than writing new pipeline components every time a slight variation of logic is required.
-Provide a simple design time experience (BRE) which encourages developers to use pipelines appropriately and makes it easier for analysts to understand the purpose of a pipeline.
-Provide an extensible framework that allows for developers to implement their relevant requirements if not catered for out of the box in the desired manner.
The BRE Pipeline Framework achieves this through the use of concepts called MetaInstructions and Instructions.
A MetaInstruction is a class that derives from MetaInstructionBase which is provided as part of the framework. A MetaInstruction is composed of helper methods which are intended to be accessed from within a BRE policy. These methods could be used to access
context information within a BizTalk message or could simply be Helper type methods such as one to check whether a string contains a given substring. A MetaInstruction also contains a collection of Instructions and optionally a set of methods that are used
to instantiate an instruction and add it to the collection.
An Instruction is a class that implements the IInstruction interface. It must implement a method called Execute which performs the logic required by that Instruction. Such logic would typically be an action that would modify something about a BizTalk message
such as it's context or content. An example would be to promote a value into the BTS.DestinationPartyName context property.
The MetaInstructionBase class also contains an overridable execute method which will perform the execute method on all contained instructions.
Now one of the key concepts of the BRE is that in order for a fact (XML document / .NET object / Database connection) to be used by a BRE policy, an instance of that fact must be asserted into the policy when it is executed. The challenge here is that the necessary
classes must be known and instantiated before calling on a BRE policy.
The BRE Pipeline Framework overcomes this challenge by making use of the plugin design pattern. It does so by exposing a method called AddBREMetaInstruction(string className, string assemblyName) which allows for any class that derives from MetaInstructionBase
to be instantiated through the use of reflection. This instantiated object would then be asserted into the BRE policy to allow you to take advantage of the methods it exposes.
The BRE Pipeline Framework includes a pipeline component called the BREPipelineFrameworkCompoment which is intended for use in all pipelines (possibly in multiple stages if required) which will allow for the instantiation of as many different MetaInstructions
as are required (this is done through a BRE policy referred to as the InstructionLoaderPolicy), the execution of as many methods on the instantiated MetaInstructions as required to implement the required logic (this is done through a BRE policy referred to
as the ExecutionPolicy), and will then execute all the Instructions that are contained within each MetaInstruction, calling the base.Execute method on each MetaInstruction in the order they were instantiated in the InstructionLoaderPolicy, and respecting
the order in which the Instructions were created in the ExecutionPolicy if any order was determined through the use of priorities set on each individual rule within the ExecutionPolicy, and by the order of the Actions within each of the rules in the BRE policy.
See the documentation page for more details on how to install, use and extend the BRE Pipeline Framework.
Johann Cooper - Creator and coordinator of the BRE Pipeline Framework. A BizTalk developer who worked on many context heavy integration projects and decided that there had to be
a better way.