Property Demotion

Published 31 August 07 02:51 PM | Dick Dijkstra 

Most people working with BizTalk have heard of property promotion, in fact property promotion is very important in CBR messaging scenarios. Property promotion makes it possible to route messages based on their content. In short, property promotion is taking information from the message and putting it in the context of a message. 

Have you ever heard of property DEmotion?? This is the opposite of property PROmotion, so taking information from the context and putting it in the message. This might become handy when you for instance need the initial filename of message. This information is stored in the context, to be more specific in the element ReceivedFileName in the schema FILE.bts_file_properties in the referenced assembly Microsoft.BizTalk.GlobalPropertySchemas. How do you get this value in your output message (demotion is done in the send port - use the XMLTransmit pipeline)?

  1. Right-click the element in your schema you want to contain the ReceivedFileName value and click Promote -> Show Promotions.
  2. Add a new property schema: choose <your schema project> -> References -> Microsoft.BizTalk.GlobalPropertySchemas -> Schemas -> FILE.bts_file_properties
  3. Choose a proper prefix e.g. btsFileProps or something, I think ns0 is dirty 
  4. Add your element and bind it to <your prefix>:ReceivedFileName and click ok

Deploy your schema and test it - your output message should contain the ReceivedFileName property value if your input message has left the element to be filled empty. Questions? Feel free to ask!

 

Filed under:

Comments

No Comments
Anonymous comments are disabled