I was having issues with BizTalk’s promoted/distinguished fields today, so I ran a small test, and I’m not sure what I have here.
What I want to see is when I change various values in a message (e.g. promoted property fields, distinguished fields, the message directly), when do the other values (e.g. promoted property fields, distinguished fields, the message directly) get updated? For instance, when I set a promoted value for a message, when does it get “pushed down”?
I have a very simple BizTalk project with a schema, property schema, and orchestration. In the schema I have a field called Node1 and I have both distinguished and promoted that field (into a property field named RoutingNode). In my orchestration, I have a series of activities where I manipulate the message in all sorts of sinister ways. Construct Block #1 has the following code contained (I’ve subtracted most of my trace statements):
SampleSchema_Output1 = SampleSchema_Input;
//print out distinguished value, promoted value, and actual XML content
System.Diagnostics.Debug.WriteLine(“Distinguished: ” + SampleSchema_Output1.Node1 + “; Promoted: ” +
SampleSchema_Output1(BizTalk.Blog.MonitorMessageChanges.RoutingNode));
xmlDoc = SampleSchema_Output1;
System.Diagnostics.Debug.WriteLine(“XML content: ” + xmlDoc.OuterXml);
//change promoted value
SampleSchema_Output1(BizTalk.Blog.MonitorMessageChanges.RoutingNode) = “changed #1”;
//print out distinguished value, promoted value, and actual XML content
System.Diagnostics.Debug.WriteLine(“Distinguished: ” + SampleSchema_Output1.Node1 + “; Promoted: ” +
SampleSchema_Output1(BizTalk.Blog.MonitorMessageChanges.RoutingNode));
System.Diagnostics.Debug.WriteLine(“XML content: ” + xmlDoc.OuterXml);
Got that? So I print out the current values stored in the distinguished field, promoted property field and then the whole message itself. Then I change the promoted property value, and print the whole thing out again. In Construct Block #2 I have the following code (all trace statements removed since you get the point):
SampleSchema_Output2.Node1 = “changed #2”;
So in that one I changed the distinguished field value. Finally, in Construct Block #3 I changed the underlying XML document itself:
//change xml directly
xmlNode = xmlDoc.DocumentElement.SelectSingleNode(“/*[local-name()=’SampleSchema’ and
namespace-uri()=’http://BizTalk.Blog.MonitorMessageChanges’%5D/*%5Blocal-name()=’Node1′ and namespace-uri()=”]”);
xmlNode.InnerText = “changed #3”;
So if you’re still with me, you may be interested in the results of this little experiment. What do you expect to be printed out after each Construct block? Here’s what I got:

I don’t think I expected that. From that experiment, it looks like the XLANG message either updates itself automatically, or, when I request the values (like distinguished fields or promoted properties) it’s checking for changes. Did I do something off here, or does this seem right to you people?
Technorati Tags: BizTalk
Leave a reply to Anil Prasad Cancel reply