EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Using %Macro%'s in BizCrypto-driven BizTalk applications

Macro is a pre-defined variable processed by a component (e.g. adapter or pipeline) before it moves on to its main task. A user assigns macros to the properties of the component, either statically (through an adapter configuration dialog) or dynamically (from within an orchestration). A widely accepted syntax for macros is %Macro% (a variable name enveloped into two percentage characters).

When a component gets something to process, it first evaluates all the known macros, replacing them with actual information it has about the message. For instance, a %MessageID% macro is replaced with a unique GUID-like BizTalk message identifier. In the above case, every new message processed by the FILE adapter will result in a file with unique name being created, effectively solving the task of naming conflicts.

Support for macros is mainly a feature of outbound components (e.g. transmit adapters); this is reasoned by two principal facts:

  1. Inbound components are quite restricted in their destinations, as all the received data goes directly to the BizTalk message box. This way, there are just not too many things that can be configured with macros here.

  2. Most information to substitute macro variables with is obtained from the message the component deals with (message id, original file name etc.). As inbound components do not deal with messages for 99% of their work (with the exception of submitting the message to BizTalk engine), they basically do not have any source of information to unfold the macros.

Though the above rule generally takes place for BizCrypto components as well, some inbound BizCrypto components do support macros in their properties. This particularly concerns SFTP and FTPS adapters, which support macros in their Safe Download Name, On Before Receive and On After Receive properties.

The complete list of macros understood by BizCrypto components is given below.

General purpose macros

%MessageID%

GUID-like message identifier, e.g. {1249EA49-FAF5-43E5-A325-5B8CE42E3FD2}

%SourceFileName%

Outbound components: the contents of BTS.ReceivedFileName message context property.


Inbound components: the name of the file that is currently being processed*.

%SourceFileNameNoExt%

Outbound components: the contents of BTS.ReceivedFileName message context property with the extension stripped off.


Inbound components: the name of the file that is currently being processed with the extension stripped off*.

%SourceFileDir%

Inbound components only: a path to the remote file that is currently being processed (file name itself is not included)**

%SourceFileFullName%

Inbound components only: a path to the remote file that is currently being processed (file name is included)**

%LocalServerName%

Local machine name

%Random83%

A random string of characters compliant to MS-DOS file naming conventions (8.3)

%Random64%

A random 64 bit integer value

Date and time specific macros***

%datetime_bts2000%

UTC date time in the format YYYYMMDDhhmmsss, where sss includes seconds and milliseconds

%datetime%

UTC date time in format YYYY-MM-DDThhmmss (e.g. 2012-01-30T031545)

%datetime.tz%

Local date time + time zone from GMT in format YYYY-MM-DDThhmmssTZD, (e.g. 2012-01-30T031545+700)

%time%

UTC time in format hhmmss

%time.tz%

Local time + time zone from GMT in format hhmmssTZD (e.g. 101505+530)

%date.d%

Day of the month as a number from 1 to 31. A single-digit day is formatted without a leading zero.

%date.dd%

Day of the month as a number from 01 to 31. A single-digit day is formatted with a leading zero.

%date.ddd%

The abbreviated name of the day of the week (Mon, Tue, Wed etc)

%date.dddd%

The full name of the day of the week (Monday, Tuesday etc)

%date.h%

12-hour clock hour (e.g. 7)

%date.hh%

12-hour clock, with a leading 0 (e.g. 07)

%date.H%

24-hour clock hour (e.g. 19)

%date.HH%

24-hour clock hour, with a leading 0 (e.g. 19)

%date.m%

Minutes

%date.mm%

Minutes with a leading zero

%date.M%

Month number

%date.MM%

Month number with a leading zero

%date.MMM%

Abbreviated month name (e.g. Dec)

%date.MMMM%

Full month name (e.g. December)

%date.s%

Seconds

%date.ss%

Seconds with a leading zero

%date.t%

Abbreviated AM / PM indicator (e.g. A or P)

%date.tt%

Full AM / PM indicator (e.g. AM or PM)

%date.y%

Two-digit year, without a leading zero (e.g. 2001 would be 1)

%date.yy%

Two-digit year, with a leading zero (e.g. 2001 would be 01)

%date.yyyy%

Four-digit year (e.g. 2001 would be 2001)

%utcdate.d%

Day of the month as a number from 1 to 31. A single-digit day is formatted without a leading zero.

%utcdate.dd%

Day of the month as a number from 01 to 31. A single-digit day is formatted with a leading zero.

%utcdate.ddd%

The abbreviated name of the day of the week (Mon, Tue, Wed etc)

%utcdate.dddd%

The full name of the day of the week (Monday, Tuesday etc)

%utcdate.h%

12-hour clock hour (e.g. 7)

%utcdate.hh%

12-hour clock, with a leading 0 (e.g. 07)

%utcdate.H%

24-hour clock hour (e.g. 19)

%utcdate.HH%

24-hour clock hour, with a leading 0 (e.g. 19)

%utcdate.m%

Minutes

%utcdate.mm%

Minutes with a leading zero

%utcdate.M%

Month number

%utcdate.MM%

Month number with a leading zero

%utcdate.MMM%

Abbreviated month name (e.g. Dec)

%utcdate.MMMM%

Full month name (e.g. December)

%utcdate.s%

Seconds

%utcdate.ss%

Seconds with a leading zero

%utcdate.t%

Abbreviated AM / PM indicator (e.g. A or P)

%utcdate.tt%

AM / PM indicator (e.g. AM or PM)

%utcdate.y%

Two-digit year, without a leading zero (e.g. 2001 would be 1)

%utcdate.yy%

Two-digit year, with a leading zero (e.g. 2001 would be 01)

%utcdate.yyyy%

Four-digit year (e.g. 2001 would be 2001)

* - the macro is only supported by Safe Download Name, On Before Receive and On After Receive properties of inbound SFTP and FTPS adapters.

** - the macro is only supported by Safe Download Name, On Before Receive and On After Receive properties of inbound SFTP adapter.

*** - date and time macros are supported in all outbound adapters and in Safe Download Name, On Before Receive and On After Receive properties of inbound SFTP and FTPS adapters.

Haven't found the macro variable you need? Let us know, and we will do our best to extend the product with support for that variable as quickly as possible.

Return to the list

|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!