WebSphere Message Brokers
File: ac12620_
Writer: Karen Cameron

Concept topic

This build: July 31, 2007 21:18:32

Environment tree structure

The Environment tree is a part of the logical message tree in which you can store information while the message passes through the message flow.

The root of the Environment tree is called Environment. This tree is always present in the input message; an empty Environment tree is created when a message is received and parsed by the input node. You can use this tree as you choose, and create both its content and structure.

There is one situation in which WebSphere Message Broker refers to (but never creates) a field in this tree. If you have requested data collection for message flow accounting and statistics, and have indicated that accounting origin basic support is required, the broker checks for the existence of the field Environment.Broker.AccountingOrigin. If the field exists, the broker uses its value to set the accounting origin for the current data record. For further information about the use of this field, see Setting message flow accounting and statistics accounting origin. (Contrast this with the LocalEnvironment tree structure, which the broker uses in several situations.)

The Environment tree differs from the LocalEnvironment tree in that a single instance of it is maintained throughout the message flow. If you include a Compute node in your message flow, you do not have to specify whether you want the Environment tree to be included in the output message. This happens automatically, and the entire contents of the input Environment tree are retained in the output Environment tree, subject to any modifications that you make using ESQL in the node. Any changes that you make are available to subsequent nodes in the message flow, and to previous nodes if the message flows back (for example, to a FlowOrder or TryCatch node).

You are recommended to create information in the Environment tree within a subtree called Variables (although this is not enforced).

An example of an Environment tree is shown below.

An Environment tree, with a Variables subtree that contains five children. The fifth child also contains children.

You could use the following ESQL statements to create the content shown above.

SET Environment.Variables = 
      ROW('granary' AS bread, 'riesling' AS wine, 'stilton' AS cheese);
SET Environment.Variables.Colors[] = 
      LIST{'yellow', 'green', 'blue', 'red', 'black'};
SET Environment.Variables.Country[] = LIST{ROW('UK' AS name, 'pound' AS currency),
   	 ROW('USA' AS name, 'dollar' AS currency)};

When the message flow processing is complete, the Environment tree is discarded.

Related concepts
Message modeling
LocalEnvironment tree structure
Correlation names
Related tasks
Developing message flows
Accessing the Environment tree
Setting message flow accounting and statistics accounting origin
Writing ESQL
Writing Java
Related reference
Built-in nodes
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:18:32

ac12620_ This topic's URL is: