Monday, April 09, 2012

BizTalk Quirks–Message Context Properties vs Scope

 

Inside orchestations it’s fairly easy to read ContextProperties (albeit Promoted/Distinguished). I had a strange issue where a was reading out a property multiple times in different scopes (in the main branch as well as the error handling to determine a value inside our msg):

Start of the orchestration

LOG(requestMessage

            (Customer.Domain.Common.Schemas.AdminID,

…..,

…..

);

When I did the exact same thing inside the orchestration in another section… I got a exception about a missing property. So unexpected and not helpful….the incoming message was not altered inside a rule, the properties were of the MessageContextBase (so not bound to the messageType) and I used the same code.

In the end I switched to a variable assignment;

variable asssignment = msg(Property);

 

So my new rule is, assign context properties as soon as possible to variables, scoping and context properties seem to conflict sometimes.

 

Captain Quirk.

2 comments:

Cindy Dy said...

I enjoy reading your articles. You really have a wonderful blogs. Keep up the good work. Thank you also for the information!

Cara
www.gofastek.com

Leslie Lim said...

Please do more articles like this in the future. Very informational and knowledgeable. I will expect more from you in the future. For now i will just bookmark your page and surely I'm gonna come back later to read more. Thank you to the writer!


www.imarksweb.org