Monday, May 2, 2005

Specifying the output filename from a BizTalk orchestration

Once again, I needed a short simple answer but found either examples that didn't match exactly or newsgroup posts that were cryptic. In my case, the target system I was feeding data to required me to specify a filename that included the month and day of posting as well as the next sequential number. Thus the format is MyOutputFile_mmdd-nnn.out where mm is the month, dd is the day and nnn is the next sequential number (in the case of multiple runs during the same day). To do this, within the message assignment block you specify:

OutgoingMsgName(FILE.ReceivedFileName) = BTSHelper.GenerateOutputFilename();

Here you are setting one of the message's context properties so it must be within the scope of the construct message. Then, in the SendPort configuration you can use the macro %SourceFileName% and it will be replaced with the filename you set in the message's context.

In this simplified example, BTSHelper.GenerateOutputFilename() is a method on a .NET helper class that contains logic for creating the filename.

Original post

No comments:

Post a Comment