For more information, see the BizTalk hands-on experiment series directory.
BizTalk Development Series
In BizTalk, macro sets can be used to dynamically replace macros with separate values for the BizTalk sending handler. Commonly used macro sending programs include: File Sending adapter and SMTP sending adapter. Multiple macros can be used in expressions at the same time. For example, if % SourceFileName % _ % datetime % _ % MessageID %. xml is used in the File Sending adapter file name, three macro values connected with "_" are expressed.
Notes for using macros
If either of the following conditions exists, the sender will not replace the macro with the value:
- System properties are not set.
- Macro spelling error.
- The symbols contained in the macro value are invalid in the file name.
In any of the above cases, the sender will keep the macro unchanged, for example, Myfile _ % MessageID %. xml.
List of macros available in the file Adapter
|
Macro name |
Substitution Value |
|
% Datetime % |
YYYY-MM-DDThhmmss format Universal Time (UTC) Date time (for example, 1997-07-12T103508 ). |
|
% Datetime_bts2000 % |
YYYYMMDDhhmmsss format UTC date time, in which, sss represents seconds and milliseconds (for example, 199707121035234 represents 1997/07/12 10:35:23 and 400 milliseconds ). |
|
% Datetime. tz % |
Add the GMT time zone to the local date in the format of YYYY-MM-DDThhmmssTZD (for example, 1997-07-12T103508 + 800 ). |
|
% DestinationParty % |
Name of the target participant. The value is from the message context attribute BTS. DestinationParty. |
|
% DestinationPartyQualifier % |
The target participant's qualifier. The value is from the message context attribute BTS. DestinationPartyQualifier. |
|
% MessageID % |
Globally Unique Identifier (GUID) of a message in the BizTalk Server ). The value is directly from the message context attribute BTS. MessageID. |
|
% SourceFileName % |
The name of the file from which the file adapter reads the message. The file name includes the extension, but does not include the file path, such as Sample. xml. When this attribute is replaced, the FILE adapter extracts the FILE name from the absolute FILE path stored in the FILE. ReceivedFileName context attribute. If the context property has no value (for example, if a message is received by an adapter other than the file adapter), the macro is not replaced, and keep the macro as is in the file name (for example, C: \ Drop \ % SourceFileName % ).
|
Note: |
|
The correct implementation of this macro requires that the output message and the received message be the same message. |
|
|
% SourceParty % |
Name of the source participant from which the file adapter receives messages.
|
Note: |
|
The correct implementation of this macro requires that the output message and the received message be the same message. |
|
|
% SourcePartyQualifier % |
The delimiter used by the file adapter to receive messages from the source participant.
|
Note: |
|
The correct implementation of this macro requires that the output message and the received message be the same message. |
|
|
% Time % |
The UTC time in hhmmss format. |
|
% Time. tz % |
Add the GMT time zone to the local time in the format of hhmmssTZD (for example, 124525 + 530 ). |
Macros supported by the SMTP Adapter
|
Macro |
Description |
Used"Recipient"Use together |
Used"CC"Use together |
Used"Topic"Use together |
|
% MessageID % |
Globally Unique Identifier (GUID) of a message in the BizTalk Server ). The value is from the message context attribute BTS. MessageID. |
No |
No |
Yes |
|
% Datetime_bts2000 % |
YYYYMMDDhhmmsss format UTC date time, in which, sss represents seconds and milliseconds (for example, 199707121035234 represents 1997/07/12 10:35:23 and 400 milliseconds ). |
No |
No |
Yes |
|
% Datetime % |
YYYY-MM-DDThhmmss format UTC time (for example, 1997-07-12T103508 ). |
No |
No |
Yes |
|
% Datetime. tz % |
Add the GMT time zone to the local date in the format of YYYY-MM-DDThhmmssTZD (for example, 1997-07-12T103508 + 800 ). |
No |
No |
Yes |
|
% Time % |
The UTC time in hhmmss format. |
No |
No |
Yes |
|
% Time. tz % |
Add the GMT time zone to the local time in the format of hhmmssTZD (for example, 124525 + 530 ). |
No |
No |
Yes |
|
% SourceParty % |
Name of the source participant from which the file adapter receives messages. |
Yes |
Yes |
Yes |
|
% SourcePartyQualifier % |
The delimiter used by the file adapter to receive messages from the source participant. |
Yes |
Yes |
Yes |
|
% DestinationParty % |
Name of the target participant. The value is from the message context attribute BTS. DestinationParty. |
Yes |
Yes |
Yes |
|
% DestinationPartyQualifier % |
The target participant's qualifier. The value is from the message context attribute BTS. DestinationPartyQualifier. |
Yes |
Yes |
Yes |
References
BizTalk Server 2006 Documentation