BizTalk Tip : Calling Rules from an Expression Shape

See below from an orchestration expression shape to call a BRE policy. Add a reference to the Microsoft.RuleEngine assembly which you will most likely find in :\Program Files (x86)\Common Files\Microsoft BizTalk\Microsoft.RuleEngine.dll. In the below after calling the Policy.Execute method from an expression shape the OrderMetadata message will be updated. Notice the assignment of the typedXmlDocument variable. This allows us to call rules with untyped messages from within an orchestration.

temporaryXml = OrderMetadata.BodyPart;
typedXmlDocument = new Microsoft.RuleEngine.TypedXmlDocument("SysTalk.Integration.Orders.Schema.OrderMetadata", temporaryXml);
policy = new Microsoft.RuleEngine.Policy("Inbound_Orders");
policy.Execute(typedXmlDocument);
policy.Dispose();
Advertisements
This entry was posted in BizTalk Server. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s