Author |
Message
|
prasannanb |
Posted: Wed Sep 08, 2010 10:10 pm Post subject: Appending values |
|
|
Apprentice
Joined: 17 Apr 2009 Posts: 35
|
Hi,
I am saving the input in the Environment variable like below
SET Environment.Variables.Respmsg = InputRoot.MRM;
then, when I get the new values in the InputRoot, how can I "append" these new values into the original Environment.Variables.Respmsg in which I already have some values?
Please help
Thanks in advance |
|
Back to top |
|
 |
swethabala |
Posted: Wed Sep 08, 2010 11:24 pm Post subject: |
|
|
Apprentice
Joined: 25 Aug 2009 Posts: 44
|
Hi,
You can assign this in form of list as below:
Declare a counter i initialised to 1
start a While looop
SET Environment.Variables.Respmsg[i] = InputRoot.MRM[i];
increment counter (i = i +1
END WHILE
In this way all the values will be stored in Respmsg as a list one by one |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 09, 2010 2:01 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There is no shared state between two instances of a message flow, unless you specifically build it using a database or etc.
Every time any *Input node processes a new message, it creates an entirely new Environment tree.
This is Broker 101. Please get training. |
|
Back to top |
|
 |
swethabala |
Posted: Thu Sep 09, 2010 2:13 am Post subject: |
|
|
Apprentice
Joined: 25 Aug 2009 Posts: 44
|
Yes if one message is processed then Environment variables will be cleared. there is no way that you can store it.
Sorry I thought you are asking about different records in same file. |
|
Back to top |
|
 |
mgk |
Posted: Thu Sep 09, 2010 2:28 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Although you could use a SHARED variable to store data between messages through the same flow... _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
prasannanb |
Posted: Thu Sep 09, 2010 4:25 am Post subject: |
|
|
Apprentice
Joined: 17 Apr 2009 Posts: 35
|
Yes I am asking about different records in the same instance of flow.
I am in a loop and each time I am getting different values in InputRoot.MRM
I want to append this value to a environment value each time so finally when I come out of loop all the values are there in single env variable. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Sep 09, 2010 4:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
prasannanb wrote: |
I am in a loop and each time I am getting different values in InputRoot.MRM |
This is a rather dubious bit of design; looping like this done carelessly (and sometimes done perfectly) can run an execution group out of memory.
There's been a number of threads in here about using aggregation or collector nodes to avoid such a loop. You may find these useful. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
visasimbu |
Posted: Fri Sep 10, 2010 11:24 pm Post subject: |
|
|
 Disciple
Joined: 06 Nov 2009 Posts: 171
|
hi prasannanb,
U may did minor mistake in your loop.. Placing your code(specially a loop) here will help you better... |
|
Back to top |
|
 |
|