Variable Substitution
This article will discuss variable substitution in Flux and where it may be appropriate.
There are three different types of variable substitution in Flux: global substitution, date substitution, and runtime configuration substitution. Substitution may not be directly used on any properties whose syntax is verified at build time including, but not limited to, Listeners, Time Expressions, and Join Expressions. If you need to substitute a value for Listeners, Time Expressions or Join Expressions, you can use runtime data mapping or the prescript of an action to dynamically set these values.
Global Substitution
Global substitution allows you to substitute a value at the runtime of a flow chart. This value can either come from an action?s variable manager, the flow context, or the flow chart's variable manager. The correct syntax for global substitution follows:
${variableName}
Date Substitution
Date substitution can be useful in searching, creating, or deleting files with names that have date representations. For example, if your server backs up a group of files every night with date, substitution you can append a date making it easier to distinguish between the different files. The correct syntax for date substitution follows:
${date (-1M) dd-MMM-yyyy}
For instance:
${date dd-MMM-yyyy} (which would result in something like 07-Jul-2007)
A list of available date formatters is listed below
|
Date Formatter |
Result |
|
yyyy |
2006 |
|
yy |
06 |
|
MMMM |
June |
|
MMM |
Jun |
|
MM |
06 |
|
M |
6 |
|
dd |
01 |
|
d |
1 |
|
DD |
Thursday |
|
D |
Thurs |
|
HH |
08 |
|
H |
8 |
|
mm |
05 |
|
m |
5 |
|
ss |
06 |
|
s |
6 |
Runtime Configuration Substitution
Runtime configuration substitution behaves similarly to global substitution, except that runtime configuration substitution deals with the engine wide configuration instead of one of the 3 variable managers (action, flow chart, flow context). Runtime substitution can pull in a value from either the engine's runtime configuration file, or the engine's runtime configuration node. This value can be different based on different branches of the tree. Runtime substitution configuration substitution is most helpful when a variable is used in more than one flow chart, for instance an email server's ip address. The correct syntax for runtime configuration substitution follows:
${runtime VariableName}
