You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Introduction

Variables are assigned constant values and expressions. This applies to:

Expressions are a means to dynamically calculate values for variables. 

Examples

  • true
  • 1
  • "STRING"
  • $VARIABLE
  • $returnCode <= 3
  • $NUMBER + 1

Data Types

Boolean

The following constant values are supported: true, false

Example:

Expressiontrue
JSON"var": true
Expressionfalse
JSON"var": false

String

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
"some value"
JSON"var": "\"some value\""
Expression
"\t means the TAB control character"
JSON"var": "\"\\t means the TAB control character\""
Expression
"\r means the CR control character"
JSON"var": "\"\\r means the CR control character\""
Expression
"\n means the LF control character"
JSON"var": "\"\\n means the LF control character\""
Expression
"\$ means the literal character"
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
1
JSON"var": 1

Operators

Comparison Operators

The operators <, <=, ==, !=, >=, > are supported.

The result of a comparison is the Boolean data type. Comparisons are available for strings and numbers. Both sides of a comparison have to use the same data type.

Should this rule not be considered and should e.g. a number be compared to a string then an Order will fail.

Example:

Expression
$var >= 199
JSON"var": "$var >= 199"

Arithmetic Operators

Addition and Subtraction of two numbers with: +, -

Example:

Expression
1 + 1
JSON"var": 1 + 1
Expression
100 - 210
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
"abc" ++ "def"
JSON"var": "\"abc\" ++ \"def\""

Conversion

Convert to Number

If a value of String data type represents a number then it can be converted. Otherwise an error is raised and the affected Order fails.

Example:

Expression
"123".toNumber
JSON"var": "\"123\".toNumber"

Convert to String

Values of the Number data type can be converted to strings.

Example:

Expression
123.toString
JSON"var": "123.toString"


Reading Variables

Referencing Variables

The syntax $VARIABLE, ${VARIABLE} is used to read the value of a variable.

Similar to a number of Unix shells a variable can be recalled with $ or with ${}. 

If the variable is unknown then an error is raised and the affected Order will fail.

Variable Function

Variables can be retrieved using the variable(NAME, label=LABEL, job=JOB, default=DEFAULT) function.

    • VARIABLE is a string expression for the name of the variable.
    • label=LABEL (optional) ist das Label einer Anweisung, in deren Ergebnis der Name erwartet wird. Das Label wird nicht in Anführungszeichen gesetzt, Beispiel: label=A.
    • label=JOB (optional) der Name eines Jobs, in dessen Ergebnis der Name erwartet wird. Der Name wird nicht in Anführungszeichen gesetzt, Beispiel: job=MYJOB.
    •  Brauchen wir das alles?







  • No labels