Page History
...
Strings are written in double quotes. The control characters \t
(tab), \r
(CR) and \n
(NL) are literally written. To suppress its special meaning the $ character is written \$
. No other characters are allowed to follow the \ escape character.
Example:
Expression |
|
---|---|
JSON | "var": "\"some value\"" |
Expression |
|
---|---|
JSON | "var": "\"\\t means the TAB control character\"" |
Expression |
|
---|---|
JSON |
|
Expression |
|
---|---|
JSON |
|
Expression |
|
---|---|
JSON | "var": "\"\\$ means the literal character\"" |
Number
Numeric constants are implemented as Java BigDecimal
values and allow integer and long values to be specified.
Example:
Expression |
|
---|---|
JSON | "var": 1 |
Operators
Comparison Operators
...
Should this rule not be considered and should e.g. a number be compared to a string then an Order will fail.
Example:
Expression |
|
---|---|
JSON | "var": "$var >= 199" |
Arithmetic Operators
Addition and Subtraction of two numbers with: +, -
Example:
Expression |
|
---|---|
JSON | "var": 1 + 1 |
Expression |
|
---|---|
JSON | "var": 100 - 210 |
String Operators
Concatenation of two strings with the ++
operator.
Should operands of type Boolean or Number be used then they are converted to String.
Example:
Expression |
|
---|---|
JSON | "var": "\"abc\" ++ \"def\"" |
Conversion
Convert to Number
If a value of a variable with String data type represents a number then it can be converted. Otherwise an error is raised and the affected order fails.
Example:
Expression |
|
---|---|
JSON | "var": "\"123\".toNumber" |
Convert to String
Values of the Number data type can be converted to String.
Example:
Expression |
|
---|---|
JSON | "var": "123.toString" |
Reading Variables
Referencing Variables
...
Consider that a call to the variable
function will fail if the variable is unknown and no default value is specified.
Example:
Expression |
|
---|---|
JSON | "\"variable( \\\"my_var\\\", job=my_job )\"" |
Comment | The value of the variable my_var is returned as available with the job my_job in a workflow. If the variable is unknown then the function fails. |
Expression |
|
---|---|
JSON | "\"variable( \\\"my_var\\\", label=my_label, default=\\\"some value\\\" )\"" |
Comment | The value of the variable my_var is returned as available with the job identified by the label my_label in a workflow. If the variable is unknown then the default value some value is returned. |
Built-in Variables
Built-in variables are available at the following scopes:
...
$js7WorkflowPath
- The unique name of a workflow. Consider that a the name does not include the folder location of a workflow.
$js7WorkflowPosition
- The position of an order in the workflow.
$js7Label
- The label of the current instruction for which an order is executed.
$js7OrderId
- The order identifier.
$js7ControllerId
- The Controller's identifier.
...
$js7JobName
- The name of the current job for which an order is executed.
$epochMilli
- The number of milliseconds since January 1st 1970 until the start of the current job for which an order is executedUTC.
$returnCode
- The numeric exit code of the current job for which an order is executed.
...
now( format='yyyy-MM-dd hh:mm:ss', timezone='Europe/Berlin' )
- The job start date. This date can be formatted using Java data date qualifiers. Optionally a time zone can be specified, otherwise by default the UTC time zone is used.
Example:
Expression now( format='yyyy-MM-dd' )
JSON "\"now( format='yyyy-MM-dd' )\""
Sample Value 2021-05-03 Expression now( format='yyyy-MM-dd hh:mm:ss' )
JSON "\"now( format='yyyy-MM-dd hh:mm:ss' )\""
Sample Value 2021-05-03 07:30:42 Expression now( format='yyyy-MM-dd hh:mm:ss', timezone="UTC" )
JSON "\"now( format='yyyy-MM-dd hh:mm:ss', timezone=\\\"Europe/Berlin\\\" )\""
Sample Value 2021-05-03 09:30:42
scheduledOrEmpty( format='yyyy-MM-dd hh:mm:ss', timezone='Europe/Berlin' )
- The date for which an orders is scheduled.
- The date formatting options are the same as with the
now()
function.