Utilizing Promoted Properties within Receive Shape Filters in BizTalk
Receive shape filters using promoted properties can provide great flexibility as to what messages your orchestration is subscribed to. Though, that flexibility also introduces some difficulty when using an typed XML Document message. Recently I attempted to utilize a receive shape filter using a promoted property within my project. However, I noticed that when using an XML Document message type as the receiving message prevented me from using the my project’s promoted properties within my receive shape filter.
As an example, below is my Property Schema showing my CurrentProcess promoted property
We can also see that i have a field within my RoutingSlip schema with the same promoted property.
After building the project, my receive shape filter does not have the option of utilizing my promoted properties within the filter when using an XML document. The fix for this, other than forgoing the using of an XML Document message type, is to change the ‘Property Schema Base’ property within the Property Schema from MessageDataPropertyBase (default) to MessageContextPropertyBase. MessageContextPropertyBase signifies to BizTalk that this particular promoted property does not necessarily have to exist within the message data of the message that it was promoted from. To put it simply, this allows for the use of the promoted properties without requiring that the message schema exist within the same project as the Property Schema, and without the orchestration having to match the message type of the incoming message with that of the promoted property.
After building the project with the above change, we can see that I can now select my promoted property within the receive shape filter of the XML Document.