Use
EagerContextWatcher.executeInChildContext(Function, JinjavaInterpreter, EagerChildContextConfig)
Execute the specified functions within a protected context.
Additionally, if the execution causes existing values on the context to become
deferred, then their previous values will wrapped in a
set
tag that gets prepended to the returned result.
The
function
is run in deferredExecutionMode=true, where the context needs to
be protected from having values updated or set,
such as when evaluating both the positive and negative nodes in an if statement.