Page History
...
- Jobs can be assigned variables from a number of sources.:
- Shell Jobs:
- JS7 - Job Resources holding constant values.
- Job Environment Variables are populated e.g. from constant values and from JS7 - Order Variables.
- JVM Jobs:
- Job Arguments populated from constant values.
- Arguments populated e.g. from Order Variables.
- Shell Jobs:
- Assignment includes to consider use of JS7 - Expressions for Variables.
- The This article explains the sources of variables and the syntax for their assignment.
Shell Jobs
Assignment of Environment Variables from Job Resources
Job Resources can be defined to hold a number of environment variables for Shell Jobs, e.g. , for example, to forward path and location environment variables for paths and locations to scripts.
- Environment variables from Job Resources are automatically available for Shell Jobs.
- Environment variables are limited in scope to the current job. Therefore modifications to environment variables by a job script are not effective beyond the scope of current job execution.
- Values for environment variables use the data type "string".
...
- The values of environment variables can be specified from:
- Constant values using the "string" data type
- JS7 - Order Variables
- Node Arguments
- Environment variables are limited in scope to the current job. Therefore modifications to environment variables by a job script are not effective beyond the scope of current job execution.
- Values for environment variables use the data type "string". Should values from assigned variables use a different data type then the value is will be converted to "string".
JVM Jobs
...
- The purpose of Job Arguments is to parameterize optional startup code of a JVM job that is run on initialization of the job, i.e. before the job will is to be executed for orders later on.
- Constant Only constant values only can be assigned.
Assignment of Arguments
Such These Arguments are used by JVM Jobs when processing orders.
...
The prefix base64:
specifies the respective data type. JVM jobs will automatically decode bas64 encoded argument values.
Find You will find examples from in the JS7 - How to pass variables with arbitrary length values to jobs article.
...
The following assignment types are available:
- Constant string values:
- This assignment type is e.g. used used, for example, with Variable Declarations for workflows and with Node Arguments.
Example for a string value:
input:GUI "
value 1"
JSON format:"var1": "\"value 1\""
Input 'value 1'
JSON Format "var": "'value 1'"
Explanation Single quoted values are considered string constants. Example for an empty string value:
input:GUI JSON format:Input ""
"
var1JSON Format "var
": "\"\""
Explanation Single quoted values are considered string constants. Example for a quoted numeric value:
GUI Input '033521'
JSON Format "var": "'03351'"
Explanation Single quoted values are considered string constants.
- Expressions: Expressions
- This assignment type is used with Environment Variables, Job Arguments and Initialization Arguments.
- Example:input:
GUI JSON format:Input $someVariable
JSON Format var1"
var": "$someVariable"
Explanation Single quoted values are considered string constants.
The following sections contain From the following chapters find a number of syntax examples for assignment of constant values and expressions.
...
Constant values are assigned by use of using single quotes or double quotes. No substitution of variables is performed within single quoted values.
Use with single quotes
Input 'some value'
Output some value
JSON "var": "'some value'"
Use with double quotes
Input "some value"
Output some value
JSON "var": "\"some value\""
For assignment of empty string values double Double quotes have to be used to assign empty string values :Input ""
Output JSON "var": "\"\""
Use with double quoted values
Input "some \"quoted\" value"
Output some "quoted" value
JSON "var": "\"some \\\"quoted\\\" value\""
Use with double quoted and single quoted values
Input "some 'quoted' value"
Output some 'quoted' value
JSON "var": "\"some 'quoted' value\""
Use with
$
character (not: variable) from a single quoted valueInput 'some $dollar value'
Output some $dollar value
JSON "var": "'some $dollar value'"
Use with
$
character (not: variable) from a double quoted valueInput "some \$dollar value"
Output some $dollar value
JSON "var": "\"some \\$dollar value\""
Use with a built-in variable and a regular expression value
Input ^${js7OrderId}\\.order\\.js7\$
Output ^#2021-11-19#P7074917077\.order\.js7$
JSON "var": "\"^${js7OrderId}\\\\.order\\\\.js7\\$\""
Use with a base64 encoded value
Input "base64:aGVsbG8gd29ybGQK"
Output base64:aGVsbG8gd29ybGQK
JSON "var": "\"base64:aGVsbG8gd29ybGQK\""
...
Assignments can reference existing variables. Variables are referenced with a leading $
and optionally with curly braces like this:
$var
${var}
Consider Note that specifying a non-existent variable will raise a run-time error.
Use without quotes
Assumevar2
to hold has the value:some value
Input $var2
Output some value
JSON "var": "$var2"
Use with double quotes
Assumevar2
to hold has the value:some value
Input "$var2"
Output some value
JSON "var": "\"$var2\""
Use with constant values from double quoted values
Assumevar2
to hold has the value:second value
Input "first value, $var2"
Output first value, second value
JSON "var": "\"first value, $var2\""
Use with string concatenation from double quoted values
Assumevar2
to hold has the value:second value
Input "${var2}first value"
Output second valuefirst value
JSON "var": "\"${var2}first value\""
Use with constant values and single quoted values
Assumevar2
to hold has the value:second value
Input "first, '$var2'"
Output first, 'second value'
JSON "var": "\"first, '$var2'\""
For variable names that include dots If a variable name includes dots, then the name has to be specified within curly braces and has to be quoted with backticks.
Within backticks any Any characters can be used within backticks, except for a backtickbackticks themselves.Input ${`mail.smtp.host`}
Output mail.sos-berlin.com
JSON "var": "${`mail.smtp.host`}"
...