Modifying File Names in BizTalk Send Adapters
November 30, 2004 Leave a comment
There are times you’ll want to control the name of a message as it’s saved to disk (default is GUID). The question arose if promoted properties were allowed; a link to this is presented below the bullets. Thanks to Todd Uhl for providing this.
- %datetime_bts2000%: UTC date time in format YYYYMMDDhhmmsss, where sss means seconds and milliseconds (e.g. 199707121035234 means 1997/07/12, 10:35:23 and 400 milliseconds)
- %datetime%: UTC date time in format YYYY-MM-DDThhmmss (e.g. 1997-07-12T103508)
- %datetime.tz%: Local date time + time zone from GMT in format YYYY-MM-DDThhmmssTZD, (e.g. 1997-07-12T103508+800)
- %time%: UTC time in format hhmmss
- %time.tz%: Local time + time zone from GMT in format hhmmssTZD (e.g. 124525+530)%DestinationParty%: Name of the destination party. The value comes from message the context property BTS.DestinationParty.
- %DestinationPartyID%: Identifier of the destination party (GUID). The value comes from the message context property BTS.DestinationPartyID.
- %DestinationPartyQualifier%: Qualifier of the destination party. The value comes from the message context property BTS.DestinationPartyQualifier
- %SourceFileName%: Name of the file from where the File adapter read the message. The file name includes extension and excludes the file path, for example, foo.xml. When substituting this property, the File adapter extracts the file name from the absolute file path stored in the FILE.ReceivedFileName context property. If the context property does not have a value, for example, if message was received on an adapter other than File adapter, then the macro will not be substituted and will remain in the file name as is (for example, C:\Drop\%SourceFileName%).
- %SourceParty%: Name of the source party from which the File adapter received the message.
- %SourcePartyID%: Identifier of the source party (GUID). The value comes from the message context property BTS.SourcePartyID
- %SourcePartyQualifier%: Qualifier of the source party from which the File adapter received the message.
The following link points to a blog presenting two ways to use a promoted property as a file name: http://geekswithblogs.net/sthomas/archive/2004/11/13/14949.aspx