1.4 Templates and Variables - jmstoolbox/jmstoolbox GitHub Wiki

Templates

JMSToolBox allows to create templates.
Templates are "JMS messages" not tied to a destinations, that are saved on the user computer and that can be send to a destination
Templates include the payload of the message and also the JMS properties (system or user)
Templates may be created from scratch (Template->New), or created from an existimg message (View Message, "Save as Template")
Templates can contain placeholders called "variables".
JMSToolBox need to know the "Template Stores". JMSToolBox always manage a "system" store, held with the other configuration files. It is possible to define other stores.

Variables

Variables are similar to placeholders in a template text payload. Variables are replaced by random or predefined values before a message template is post to a destination
Variables may be defined in the payload of TextMessage and in "values" of MapMessage
Users can create their own variables. Those can be shared with other JMSToolBox users, by using the "Export/Import" menu
Currently, if a variable placeholder is present multiple time in a template, the value of the variable at run time will be the same for all the instances of the variable
An easy way to insert a variable into a template is to use the "CTRL + <space>" keyboard shortcut
To insert a variable in a template use the following syntax:

${<variable name>}

User variables

Different kind of variables can be created for different needs and behavior:

Variable Kind Variation Attributes Value
STRING ALPHABETIC length A string with random alphabetic characters
STRING ALPHANUMERIC length A string with random alphanumeric characters
STRING NUMERIC length A string with random numeric characters
STRING CUSTOM length, chars[] A string with random characters from "chars[]"
DATE STANDARD pattern Current date with the specified "pattern"
DATE RANGE pattern, minDate, maxDate Random date between "min" and "max" dates with the specified "pattern"
DATE OFFSET pattern, offset, timeUnit Current date with the specified "time offset" and the specified "pattern"
INT minValue, maxValue Random number between "minValue" and "maxValue"
LIST String[] Random value from "String[]"

System Variables

For commodity, JMSToolBox comes with "system" predefined variables.

Name Role
${currentDate} Current date with format "yyyy-MM-dd"
${currentTime} Current time with format "HH:mm:ss"
${currentTimeStamp} Current timestamp with format "yyyy-MM-dd-HH:mm:ss.SSS"
${xmlCurrentDateTime} Current dateTime with format "yyyy-MM-dd'T'HH:mm:ss.SSS""
${int} Random integer between 0 an 9999
${string} String of 16 random alphanumeric characters
⚠️ **GitHub.com Fallback** ⚠️