tJava vs tJavaRow

One Star

tJava vs tJavaRow

Hi,
I have a problem with the usage of the components tJava and tJavaRow. In the attached screenshots you can see a job where I iterate through a directory containing XML files. In the following example 4 identical XML files are included in the directory:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<nodeA>
<Value key="KeyA">Some text</Value>
</nodeA>
</root>
Via XPath in tFileInputXML I would like to read some values from the XML tree and create a new filename for every XML file. In the example I read the text of the <Value> node. In the following Java component I compose the new filename.
Using component tJavaRow all the values ("Some text" in this example) are read correctly. Using component tJava the value read from the first XML file is null (see the screenshot). What is the reason?
Moderator

Re: tJava vs tJavaRow

Hi,
Have you already checked talend KB article about TalendHelpCenter:The difference between tJava tJavaRow and tJavaFlex?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tJava vs tJavaRow

Thanks. The info from the article that component tJava is executed first and once in the subjob made it clearer to me.

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

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch