So what does Msg2(*) = Msg1(*) do exactly?

A question was recently raised on the biztalkgurus.com forum, that went something along the lines of:

I’ve seen the phrase Message2(*) = Message1(*) in the ‘helper text’ for the Message Assignment shape, but I’m not too sure what it does, or how it is different from Message2 = Message1. Any ideas?

I replied to the question, albeit in haste and posted an incorrect answer, stating that Message2 = Message 1 copies only the message parts and not the context, whereas Message2(*) = Message1(*) copies everything *including* the context. I was mercilessly shot down by both Tomas Restrepo and Stephen W. Thomas for providing an incorrect answer (thanks guys!).

In an attempt to save face, I spent some time today investigating exactly what that statement does (given that there is little useful information available on the interweb). As correctly answered by Tomas and Stephen:

Message2(*) = Message1(*) copies across only the *context* of the message and nothing else. The purpose of the statement is to allow you to copy context properties to a new message that has been created using a transformation (a map) as context properties aren’t copied across in a map.

In my test scenario, I created two messages: one from a map and a second from a map plus the construct statement above, to copy across the context properties. The results can be found in the following two screenshots: standalone transformation and transformation plus context properties. As you can see, the properties have been copied across in the latter.

Its usage would be something along the following lines - in a construct message shape, the statement would appear following a transformation (’Apply Map’) in the Message Assignment shape (’Two(*) = One(*)’):

Message Assignment Shape - Orchestration Example Usage
The Message Assignment shape would be configured as follows:
Message Assignment Shape - Expression Example Usage
This has certainly been a learning experience for me and something that I should have known, but I’m happy to admit I’m wrong. Thanks to Tomas and Stephen in showing me the error of my ways.

2 Responses to “So what does Msg2(*) = Msg1(*) do exactly?”


  1. 1 Tomas Restrepo

    It’s cool, Nick :) To be honest, I used to think that Msg1 = Msg2 would only copy the message content and not the context as well. The only reasons I knew better now was that a client had an issue with this and I had to do a bit of research to discover it copied the context as well :)

  2. 2 Ryan CrawCour

    Nice going … I needed to know this for a whilst and it’s been on my backburner list of things to get to one day. Tick. One less item to research.

Leave a Reply