Unable to get globalvaraible value in tjava

Highlighted
Five Stars

Unable to get globalvaraible value in tjava

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?

 

Tags (1)
Forteen Stars

Re: Unable to get globalvaraible value in tjava

Hi

 

it looks like you do wrong, check for begin some information here - https://help.talend.com/reader/KxVIhxtXBBFymmkkWJ~O4Q/yjzLPbgCOJF~YJGNskhmMQ

 

you do not need to use (String)globalMap.get(row1.name) in tSetGlobalVar, but need when use it

System.out.println((String)globalMap.get("mykey"))

 

for assign row1 to variables - check documentation about tFlowToIterate - it do this for you

-----------

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download