arrays in globalmap variables

One Star

arrays in globalmap variables

Hi
I'd like to store the value of a column into an array, each row in it's own element. Is there a way to accomplish this? I would need to be able to access the previous rows' values from the same array, so it should be a globalmap variable.
So it should be something like this:
globalMap.put("array",input_row.column_1);
Then I'd access them as follows:
globalMap.get("array")
row value
1 a
2 b
3 c
4 d
5 e
Array would be "c", as the array would be populated starting from 1 only.
Thanks in advance
One Star

Re: arrays in globalmap variables

Hi
Why don't you just put all these data into globalMap?
I don't think it will make things simple to save an array in globalMap.
Regards,
Pedro
One Star

Re: arrays in globalmap variables

Why don't you just put all these data into globalMap?
I don't think it will make things simple to save an array in globalMap.

Hi
Do you mean I should create a one globalmap per row? I can have 1-n rows coming in, and array would be flexible in that regard, as it can store any number of values.
Is it impossible to store arrays in globalmap at all?
Thanks
One Star dmi
One Star

Re: arrays in globalmap variables

For people who might end up here, like me, the answer is: as long as it's an object, globalmap accept it. But you have to know its class. For an array, you can use a java.util.List in the old fashioned way of java programming.
One Star

Re: arrays in globalmap variables

you can use List,and put List into globalMap