There are many approaches to this. I’ll give the simple (or basic) way to do.
Set the FILE.ReceivedFileName and use the %SourceFileName% macro
In the orchestration Construct Message shape, add a Message Assignment shape and then you can set the FILE.ReceivedFileName property for your flat file message as so:
OutputMsg(FILE.ReceivedFileName) = System.DateTime.Now.ToString("yyyyMMdd") + “.txt”
This sets a context property that will then be used when you wire a static send port to your orchestration port. In your static send port you specify the FTP adapter with a target file name like:
And the FTP adapter then replaces the %SourceFileName% macro, giving you a filename like “20101125.txt”
So whether you use the file or FTP adapter it is always FILE.ReceivedFileName you need to use.
Tags: BizTalk | Macros | FTP Adapter