The Let
transform wraps another transform, creating a new scope that extends the existing scope.
SpEL expressions inside the Let
can access variables from both the existing scope and the new scope.
Variables defined by the Let
must not shadow existing variables. If they do, those existing variables become inaccessible.
Syntax reference
let VAR = SPEL-EXPRESSION [, VAR = SPEL-EXPRESSION]* in {
...
}
Where:
VAR
is the variable you want to use.SPEL-EXPRESSION
is the SpEL Expression you want to use.
Execution
The Let
transform adds variables to the new scope by computation of SpEL expressions.
let aVar = "a" in {
}
Symbols defined in the Let
are evaluated in the new scope in the order they are defined. This means that symbols lower in the list can make use of the variables defined higher in the list but not the other way around.
Content feedback and comments