faqts : Computers : Integration : BizTalkServer2004

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

6 of 6 people (100%) answered Yes
Recently 6 of 6 people (100%) answered Yes

Entry

Macros - how to put a promoted or distinguished field into the output file name of a send port. So for instance, the macro %MessageID%" substitutes the GUID of a message; you can specify "myfile%MessageID%.xml" as a Send Port Filename. Many people would like to put a PONumber or CustomerNum in the filename itself.

Apr 6th, 2005 22:50
Balaji Ramachandran, http://biztalk-training.com/Default.aspx?tabid=57


In your orchestration (this solution does require Orchestration) set 
the FILE.ReceiveFileName to what you want the file
name to be in a Message Assignment Shape after you create the outbound 
message:
InvoiceMessage(FILE.ReceivedFileName) = "Test12345.xml" 'This could be 
more complicated (see below). 
in your send port under FILE Transport Properties
File name: %SourceFileName%
Hope this helps you.
This trick was from Microsoft Community Orchestration, answer posted by 
Bill Chesnut. Above from Post from Microsoft Newsgroup 6/13/2004.
Following additional examples by Neal Walters: 
I recently did a demo of this in class and it was remarkable easy. 
I was receive a "StubbornPO" and converting it to an 'EasyPO" using a 
Transform shape (map). I added a Message-Assignment shape after the 
Transform and added the following line of code: 
mEasyPO(FILE.ReceivedFileName) = mEasyPO.PONumber + ".xml"; 
Note that "PONumber" was a distinguished field in my schema. 
I suppose if you wanted to further add the %MessageID%.xml in the send 
port, you could leave the ".xml" out in the orchestration code above 
(you probably don't want two .xml's in your filename). 
I did prefix the message with additional text and the additional text 
got added just fine in front of the "FILE.ReceivedFileName". So for 
example in my send port I set filename = "OrchLargePO_%SourceFileName%" 
and since my PO number was "STU-002" the ultimate filename 
was "OrchLargePO_STU-002.xml". 
Later I will see what effect this has on HAT and tracking.