Configuring the local environment tree Variables folder by using the Cast function
You can use the Cast function to define variables in a message map that are defined in the local environment tree Variables folder.
Before you begin
Customize the message map to include the local environment tree. For more information, see Customizing a message map to include the local environment tree.
About this task
The local environment tree is a part of the logical message tree in which you can store information while the message flow processes the message. You use the local environment tree to store variables that can be referred to and updated by message processing nodes that occur later in the message flow. You can also use the local environment tree to define destinations (that are internal or external to the message flow) to which a message is sent.
When you add the local environment tree to a message map, you must provide transforms for all of its elements so that the input values of each element are not lost. You can copy the input field unchanged or modified by a transform. Many IBM® App Connect Enterprise nodes depend on information in the local environment tree being copied along the message flow.
The variables folder in the local environment tree is defined as xsd:any. When you add the local environment tree, you can see the structure of the destination folders with all its elements, and a Variables folder with a single element defined with a generic type.
You manually define the elements that are included in the Variables folder. There is no predefined structure for the Variables folder. Each message flow has its own local environment tree Variables folder. For this reason, if you want to access any of these elements within your message map, you must define each element that you want to use in the message map by using the Cast function.
- You can use the Cast function to explicitly define other elements in the message map message assembly.
- In IBM App Connect Enterprise, the local environment tree predefines other folders to reflect the data created and used by IBM App Connect Enterprise nodes.
In this scenario, you create an element called Country under the local environment Variables folder to be used by other nodes later in the message flow for routing.
Procedure
To add the Country element to the local environment tree Variables folder complete the following steps:
Results
You now have defined one local environment variable that can be used by other nodes in your message flow for routing or filtering.
You can see the element Country under the local environment Variables folder in the message map.
What to do next
Configure the message map to include the SOAP message. For more information, see Configuring the message map to include the SOAP message.