Eric’s BizTalk 2004/2006 Blog

My BizTalk Experiences using Flat Files, InfoPath, BAM, BRE, BAS, HL7, HIPAA, WSS.

March 1, 2006

Macros in a Dynamic Send Port

Filed under: BizTalk — eric @ 11:39 pm

A recent post in the BizTalk forum, promted this entry.

The question was asked how you can put the MessageID into a dynamic send port. I suggested that you would put a rule SendPort(Microsoft.XLANGs.BaseTypes.Address)=@”file://c:\”+DocumentMsg(BTS.MessageID)+”.xml”;
The next post was telling that you can put the macro in the Expression, which is true, you can, but in the below demo, it shows why it would be preferable not to use the macros.
I created a simple orchestration that shows both ways, here is the orchestration:
MessageID2.JPG

Here is the expression rule:

Here is the results of running the file through the orchestration:

MessageID5.JPG

In HAT, which is where I think that the real value of which method you use lies, here is the message flow, notice the filename is right in the first page of the message flow for the first outbound message, and the macro %MessageID% is found on the second message:

MessageID3.JPG

The message that uses the macro, you have to click on the link to see the actual message ID of what was saved.

MessageID4.JPG 

Again, here is the output:
MessageID5.JPG
At a recent client site, I used the macro initially, but then moved to the BTS.MessageID to ease in troubleshooting. Saving a couple of clicks when attempting to find the file really adds up after a while.

Below is a link to the sample solution that allows you to look at it and try it on your own.

Here

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.