One Star

Writing data from a tJavaFlex into an output

I have stored inside a routine a Hashmap that contains my data in various stages of completion. at the end on an iteration cycle i need to write the data in memory into a tFileOutputDelimited.
I use a tjavaFlex component,in the start section I call the map from the routine and then iterate though the hashmap in order to populate the output in the main section
i.e. row8.pk = object.getPK();
the problem is that only one row is passed into the tFileOutputDelimited, the last row. does anyone know how I can write the complete hashmap into the tFileOutputDelimited
Thank you
5 REPLIES
One Star

Re: Writing data from a tJavaFlex into an output

Hi
Could you show us the code in tJavaFlex?
And normally there must be some workaround to solve this issue without tJavaFlex.
Need more info.
Regards,
Pedro
One Star

Re: Writing data from a tJavaFlex into an output

Start code:
MediationRoutine.flushUDRMap(); // A method that removes all merged data
HashMap<String,ArrayList<UDR>> map = MediationRoutine.getUDRMap().getMap();// retrieves the Map from the routine

Main code:
for (Iterator<ArrayList<UDR>> iterator = map.values()
.iterator(); iterator.hasNext()Smiley Wink {
ArrayList<UDR> list = iterator.next();
for (Iterator<UDR> iterator2 = list.iterator(); iterator2.hasNext()Smiley Wink {
UDR udr = iterator2.next();
row8.pk = udr.getPk();
}
}
row8 is the name of the connector that connects to a tFilterRow
One Star

Re: Writing data from a tJavaFlex into an output

Hi
The reason you get only one row is that the for loop is only in Main code.
Try to do this. Type the start part of for-loop in start code. Type the end part "}" in the end code.
Regards,
Pedro
One Star

Re: Writing data from a tJavaFlex into an output

Ah thank you so much Pedro really appreciate the help works like a charm.
One Star

Re: Writing data from a tJavaFlex into an output

Hi
Great!
Feel free to ask any question here.
Regards,
Pedro