One Star

tJava vs tJavaRow

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"?>
<Value key="KeyA">Some text</Value>
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?

Re: tJava vs tJavaRow

Have you already checked talend KB article about TalendHelpCenter:The difference between tJava tJavaRow and tJavaFlex?
Best regards
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.