Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Tjava unable to populate value of previous component

Hi People,

I am newbie to talend...and was trying out to build a job....

My requirement is

tRowGenerator >>   Row1>>tSetGlobalVariable>>row2>>tJava

I have generated one random field called name using TalendData.getname() function. E.g (Aarya)

 

in tSetGlobalVariable

For Parameter "myKey"

Value " (String)globalMap.get(row1.name)"

 

In tjava

System.out.println("myKey")

 

unfortunately I output as myKey and I expect Aarya.

 

Can some one explain what am I doing wrong?

 

Labels (3)
1 Solution

Accepted Solutions
6 Replies
akumar2301
Specialist II
Specialist II

No need to tRowGenerateor 

in tSetGlobalVar , put "myKey" as TalendDataGenerator.getFirstName().

 

the in tJava 

 

System.out.println((String)globalMap.get("myKey"));

 

 

Anonymous
Not applicable
Author

Hi Abhishek,

Thanks for your reply....

Unfortunately I get null....
akumar2301
Specialist II
Specialist II

It is quite simple can you show your job .

 

Did you connect tSetGlobalVat to tJava on OnsubjobOK ?

 

Can you please give screenshot of your job

Anonymous
Not applicable
Author

Hi Abhishek,

Thanks a lot....It worked now....

Can you please explain or provide me some document which will help me understand reason behind using OnsubjobOK?
akumar2301
Specialist II
Specialist II

https://help.talend.com/reader/nXPtKhielAtSqFD6_f7~OQ/JUkDAmEh26ipMZfskbUXjQ 

 

Above will help.Please mark topic as resolved.

Anonymous
Not applicable
Author

Thanks a lot Abhishek!!!....