|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
When to use Environement vs. LocalEnvironment |
« View previous topic :: View next topic » |
Author |
Message
|
kwelch |
Posted: Thu Mar 21, 2002 11:10 am Post subject: |
|
|
 Master
Joined: 16 May 2001 Posts: 255
|
I don't understand when it is appropriate to use Environment.Variables vs. LocalEnvironment.Variables or if it matters. Can someone explain this to me?
Thanks.
Karen
[ This Message was edited by: kwelch on 2002-03-21 12:22 ] |
|
Back to top |
|
 |
devans |
Posted: Fri Mar 22, 2002 2:28 am Post subject: |
|
|
Apprentice
Joined: 18 Mar 2002 Posts: 43
|
The differences between the two come down to the scope of your data. Suppose we have a message flow with compute nodes wired as follows
+-- B -- C
|
A --+ +- E
| |
+-- D --+
|
+- F
(Apologies if the variable-width font ruins the diagram)
Changes made to the "Environment" are visible anywhere else in the message flow. Therefore, if you add a variable to the Environment in node C, it will be visible in node F.
Changes to the "LocalEnvironment" can be made in two ways - you can modify the InputLocalEnvironment or the OutputLocalEnvironment.
If you use the OutputLocalEnvironment, then you are starting a new scope where only nodes downstream can see the changes. Therefore, if node B puts data into OutputLocalEnvironment, that data will be visible in node C, but nowhere else in the flow. This is probably what most people do.
If you use the InputLocalEnvironment, then you are using someone else's scope. If node D starts a new scope (new OutputLocalEnvironment), and node E uses the existing scope (InputLocalEnvironment), then node F will be able to see the changes that E made, but those changes would not be visible to A, B, or C.
If you are using a combination of InputLocalEnvironment and OutputLocalEnvironment, then be mindful of the "Compute Mode" setting on the "Advanced" tab of the Compute node. If you wish to propagate the OutputLocalEnvironment, make sure you choose a setting with "LocalEnvironment" in. If you want to propagate the InputLocalEnvironment, choose a setting *without* "LocalEnvironment" in. |
|
Back to top |
|
 |
devans |
Posted: Fri Mar 22, 2002 2:32 am Post subject: |
|
|
Apprentice
Joined: 18 Mar 2002 Posts: 43
|
Sorry. The diagram was garbled. Picture this in your mind
A is the root
A has two children - B and D
B has one child - C
D has two children - E and F |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|