– Custom promoted properties inside a pipeline
– Schema Property: “Property schema base”
– Direct binding to the message box
I have spent a lot of time in the past few weeks working with promoted properties through property schemas. I was using the standard approach, to simply set the promoted properties inside the schema. This, in turn, would allow the properties to be promoted inside the pipeline with no additional effort on my part.
This led me into working with custom pipelines that promoted additional properties that are not inside my message. Once custom properties are promoted, I wanted to use these items for routing to an Orchestration.
Example: I want everything processed by pipeline X and pipeline Y to promote a property named myCustomProp that says “I belong to group A”. Then, I want all group A items to be processed by Orchestration 1. I accomplished this by writing a custom pipeline component that promotes predefined text into myCustomProp. Then, I used direct message box binding on the Receive Shape of the Orchestration to pick up message that have this property.
CRITICAL: You will need to change this property inside the Orchestration to something other then “I belong to group A” before you send the message. Otherwise, when you send it and the Orchestration will start again because it will match the subscription again.
The key point here is I want to set up a filter shape based on my new promoted property that I promoted inside my custom pipeline. This property does not exist inside the schema of my received message. I started getting the following error when I tried to build my Orchestration:
“message data property ‘MyPropertySchema.myCustomProp’ does not exist in messagetype ‘msgStart’
Ok, so what does this mean?
BizTalk is helping you out my looking inside your message and telling you ahead of time that your property does not exist. What a great feature, but in this case we do not want this enforced.
How do I fix it?
Simple solution… Although it took me hours to figure out.
There is a property that can be set on each element node inside your property schema. This property is inside the Reference sections named Property Schema Base.
What is this used for?
It is used to specify the origin of the data that will be promoted into that Element in the Property Schema. I did not realize how important this property was.
The two values for this property are:
MessageDataPropertyBase (Default) – This means the data used to populate this field will come from a message
MessageContextPropertyBase – This means the data use to populate this field may or may not exist in a message. i.e. it could be prompted inside a custom pipeline and set to values not inside the message.
Well, it turns out that setting the Property to the correct value is the key to building your Orchestration. Setting this value to MessageContextPropertyBase will allow the Orchestration build since this property will not be expected inside the message.
Take Away: When you are working with Promoted Properties that may or may not be included inside your message make sure you set the Property Schema Base property to MessageContextPropertyBase.