Orchestration Mapping and Message Context in BizTalk 2004

Message context is a critical part of message routing and processing inside BizTalk Server 2004.  How this context is handled during mapping is different depending on the location of the mapping.  The context is copied differently using Receive Port mapping verses Orchestration mapping.

Why should you care?  If you are using Direct Message Box Binding to route message out of an Orchestration you might not have the correct context propertied to route your message.  This only impacts messages that needed to be routed out of an Orchestration based on a value in the original pre-mapped message.

Let’s look at the two types of mappings and what happens to the context.

Receive Port Mapping

This is a common type mapping since it generally allows for greater flexibility.  Receive port mapping occurs after the pipeline completes.  This means that context properties will already be promoted by various stages of the pipeline.  In this case, the new mapped message has all the original context values of the initial message with any duplicate values updated (i.e. like message type is now the type of the mapped message).  In addition, any prompted values in the mapped message are now promoted into the context.

To sum it up, Receive Port mapping yields a superset of message context data from both the original message and the new mapped message.

Orchestration Mapping

Orchestration mapping behaves in a totally different manner.  Using Orchestration mapping, the context of the original message is NOT copied automatically into the newly created message.  But, any promoted fields in the new message are promoted into the message context after mapping.

Getting the original message context into the new message is easy.  Just add a Message Assignment shape after the transform but inside the same Construct.  Add the following code:  MessageOut(*) = MessageIn(*)

This would look something like this:

!

This will copy the entire context from the original message into the new message and result in a superset just like the Receive Port mapping.  Individual message context fields can also be copied using this same method.

To sum it up, Orchestration Mapping does not copy original message context by default.

Overall, it is import to know what values are inside your message context as your message flows through your workflow process.  This will ensure correct message routing and help resolve routing failures quickly.

This article is part of the GWB Archives. Original Author: Stephen W. Thomas

New on Geeks with Blogs

  • We Won The One Award I Actually Care About

    Full Scale made the Inc. 5000 for the fifth year straight, the 12th listing across my three companies. Here is why the one award you cannot buy is worth stopping for.

  • Your Customers Build the Features Now

    I let a tool I liked sit dead for a year rather than build the features I wanted. An MCP server meant I never had to, and your customers can do the same to your product.

  • Get the Size of a Directory in Linux the Easy Way

    du -sh for the quick answer, ncdu for the cleanup, df for the disk itself: every command for checking directory size in Linux, plus why du and df never agree.

  • Vim Search and Replace: The Ultimate Guide

    One :%s command replaces every match in a file before a find dialog would even open. The Vim substitute patterns worth the muscle memory: flags, ranges, capture groups, and multi-file edits.