You are not logged in.
Announcement
Unanswered posts
|
Hello
I am assuming map1 is now a new instance of a map which i can traverse through. Do you have any sample code a s I am new to Java and Talend.
Yes, it create a new instance. I don't have any sample here, it is Java knowledge, if you have any questions/trouble, feel free to post it on our forum, there are so many warn-heart users and Talend developpers(include me) monitor this forum and help you. ![]()
Best regards
shong
thank you for the response. I am assuming map1 is now a new instance of a map which i can traverse through. Do you have any sample code a s I am new to Java and Talend.
Cheers
Hello
so the name of the globalmap is prism. How can I traverse this in a tjavacomponent to output to console.
On tJava:
java.util.Map map1=new java.util.HashMap();
map1=(java.util.HashMap)globalMap.get("prism");Best regards
shong
Hello,
I am building a job so that I can better undertsand how Talend Global Map works. I followed this example below http://www.talendforge.org/forum/viewto … ?pid=35618 which inserts a java map into the Global Map. I want to go a step further and am trying to traverse the globalmap within a tjava component. My components in the job are as follows:
1)mssqlinput>>2)tJavaFlex>>3)tJava
1) mssqlinput: I get rows from SQL DB, only two columns
2) tjavaflex: I create a Map and insert the map into the GlobalMap:
// start part of your Java code
java.util.Map map=new java.util.HashMap();
// here is the main part of the component,
// a piece of code executed in the row
// loop
map.put(row1.orderno, row1.mbaseprice);
// end of the component, outside/closing the loop
globalMap.put ("prism", map);
so the name of the globalmap is prism. How can I traverse this in a tjavacomponent to output to console.
Thanks in advance