You can use the Add User-Defined function to define variables in a message map that are defined in the local environment tree Variables folder.
Sometimes you use information that is passed in a variable in the local environment tree. In other instances, you might need to calculate the output value of a different element in the message body that is based on one of the local environment variables. You can also set variables in the output local environment, and use them for routing in the message flow. To configure the local environment tree Variables folder so you can use its elements as part of your transformations, complete the following steps:
You have a message assembly structure that includes the local environment tree, and its Variables folder includes an any element, and other elements.
Define transforms between the input local environment tree and the output local environment tree. For more information, see Specifying a transform (mapping operation) and Transform types in the Graphical Data Mapping editor.