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.

Comments

Popular posts from this blog

Azure implementation guidelines

Focus and innovation - recap of the last 2 years

BizTalk Pub/sub vs Topics based routing–discussion