Using Context Adder Pipeline Component with BRE Policy configuration

Installation and Configuration

  1. Install Pipeline and Pipeline Component
  2. Create receive port
  3. Create receive location and with one of the following pipeline component (see Figure 1)
    1. BREContextAdderPassthruPipeline
    2. BREContextAdderXmlRcfPipeline
  4. Create the appropriate BRE Policy or import the provided sample policy xml (see sample below) into BizTalk Rule Engine (see Figure 2)

Figure 1

BRE Context Adder Pipeline Components.png

Figure 2

BRE context adder.png

Sample BRE Policy XML

BRE Context Adder Pipeline Component calls the rule engine in the pipeline, the result of the policy will return the context properties (with namespace, key and value) to be written/promoted in the message context. Here is a sample of the Policy XML. As you can see, the number of context properties to be written/promoted is highly configurable. New property could be added/removed anytime during run time.

<?xml version="1.0" encoding="utf-8"?>
<brl xmlns="http://schemas.microsoft.com/businessruleslanguage/2002">
  <ruleset name="BREContextAdder">
    <version major="1" minor="0" description="" modifiedby="MSOIT\gli" date="2009-11-03T17:49:37.781931-05:00" />
    <configuration />
    <bindings>
      <class ref="Hashtable" class="Hashtable" instance="0" instances="16" selectivity="1">
        <assembly>mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</assembly>
        <!--c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll-->
        <namespace>System.Collections</namespace>
      </class>
    </bindings>
    <rule name="ContextAdder" priority="0" active="true">
      <if>
        <compare operator="greater than or equal to">
          <vocabularylink uri="3f0e9bcc-6212-4e6a-853c-e517f157a626" element="4ac045f2-f5ad-42cf-8e20-76d3f7f683f1" />
          <lhs>
            <function>
              <classmember member="get_Count" sideeffects="true">
                <classref ref="Hashtable" />
              </classmember>
            </function>
          </lhs>
          <rhs>
            <constant>
              <int>0</int>
            </constant>
          </rhs>
        </compare>
      </if>
      <then>
        <function>
          <classmember member="Add" sideeffects="true">
            <classref ref="Hashtable" />
            <argument>
              <constant>
                <string>ContextProperty0</string>
              </constant>
            </argument>
            <argument>
              <constant>
                <string>true; http://GML.BizTalk.PropertySchemas; PartnerName; KOKO; System.String</string>
              </constant>
            </argument>
          </classmember>
        </function>
        <function>
          <classmember member="Add" sideeffects="true">
            <classref ref="Hashtable" />
            <argument>
              <constant>
                <string>ContextProperty1</string>
              </constant>
            </argument>
            <argument>
              <constant>
                <string>false; http://GML.BizTalk.PropertySchemas; ID; 1999; System.Int32</string>
              </constant>
            </argument>
          </classmember>
        </function>
        <function>
          <classmember member="Add" sideeffects="true">
            <classref ref="Hashtable" />
            <argument>
              <constant>
                <string>ContextProperty2</string>
              </constant>
            </argument>
            <argument>
              <constant>
                <string>true; http://GML.BizTalk.PropertySchemas; Resubmit; false; System.Boolean</string>
              </constant>
            </argument>
          </classmember>
        </function>
      </then>
    </rule>
  </ruleset>
</brl>

Last edited Jan 21, 2011 at 4:47 AM by GuoMingLi, version 3

Comments

No comments yet.