Pages

Sunday, July 20, 2014

BizTalk Server - Read Custom Promoted Properties In Orchestration

Problem : 

How to read a custom promoted property, which is promoted in the custom pipeline component,  inside orchestration

The below screen shot shows the custom property promoted in the pipeline under the property name HotelCode with value 00868 and Namespace http://somecustom.promotedprop/SOAPProperties  (please note that the namespaces are cleansed for security reasons) . Now you need to read this promoted property inside orchestration.



Solution:

Firstly you need to create a property schema with the target namespace same as custom promoted property namespace i.e.,  http://somecustom.promotedprop/SOAPProperties (please note that the namespaces are cleansed for security reasons) 


Next you need to create an element in the property schema with same name as custom property name i.e, HotelCode. Also set Property Schema Base to MessageContextPropertyBase as we have the property already available in the context. After you do all the steps your property schema should look like the one in above screenshot.

Now you can read this property in the orchestration expression shape(all job of reading the custom property into the property schema element HotelCode is taken care by BizTalk). 

You can read the context property from message using the following syntax

Message(PromotedPropertyFullyQualifiedName)

eg., Assume 
  • variable name Variable_HotelCode which of type String 
  • Message name Message_HotelBooking
  • BizTalk solution default namespace CustomPromotedPropertyDemo

Code would be :

Variable_HotelCode = Message_HotelBooking(CustomPromotedPropertyDemo.HotelCode);


If you have any questions please reach me on baluragala@gmail.com