Let transform

This topic tells you about the Application Accelerator Let transform in Tanzu Application Platform (commonly known as TAP).

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.

check-circle-line exclamation-circle-line close-line
Scroll to top icon