Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | DSPs and building output templates | Using Output Templates to Format Service Output | %rename%
 
%rename%
You use the %rename% tag to move or copy a variable in the pipeline.
Syntax
%rename SourceVar TargetVar [option option option...]%
Arguments
SourceVar is the name of the variable that you want to move or copy. SourceVar can reside in any existing scope or document.
TargetVar specifies the name of the variable to which you want SourceVar moved or copied. TargetVar must be in the current scope. If TargetVar does not exist, it will be created. If TargetVar already exists, it will be overwritten.
Options
You can use the following option with this tag.
Option
Description
-copy
Copies SourceVar to TargetVar instead of moving it to TargetVar.
If you do not use -copy, SourceVar is deleted after its contents are copied to TargetVar.
Effect on Scope
Does not cause scope to switch to a different level, but, depending on how you use this tag, it may alter the contents of the current scope.
Examples
The following example renames the state variable in the current scope.
.
.
.
%scope buyerInfo%
%rename state ST%
%invoke TMPL_ShipToBlock.html%</p>
%end%
.
.
.
The following example copies the variable named oNum from the previous scope into the current scope.
.
.
.
%invoke orders:getCustInfo%</p>
%rename ../oNum oNum -copy%
%invoke orders:getOrderDetails%</p>
.
.
.