Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Red1
Contributor
Contributor

How to use the iterate flow from a tJava component?

I just noticed last week that the tJava component has an iterate flow.  Has anyone used this before?  Is there an example of how to use it?  Please note that I am not talking about the tJavaFlex component.

 

Just for clarification I am adding this photo and I modified the subject

 

0683p000009LtLn.png

 

Notice how it is the tJava Component that has the iterate flow

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

No, whatever is in the tjava component would just run first. There would be no way to control the iteration from there.

View solution in original post

13 Replies
manodwhb
Champion II
Champion II

TRF
Champion II
Champion II

Hi,

Just like other components, use the iterate connection to connect tJava to a starting component such as tFileInputDelimited or others.

Have a look to the documentation for more details

https://help.talend.com/reader/lChEGrKIFb8DXl9sRsX~~A/UoOiqbEZUVnVX9rFcx02QQ

Red1
Contributor
Contributor
Author

I am trying to figure out why the tJava component has an iterate flow.  Is it possible to use? See the picture that I added for clarification. 

Anonymous
Not applicable

It acts similar to a tFlowToIterate. Let's say, you send 10 rows from a table to tJava and print something. You will only see that print once. You then iterate to another tJava where you can then print for each individual value.

Anonymous
Not applicable

0683p000009LtXZ.png

Anonymous
Not applicable

I tried to grab row1 and got a null as expected, but after the iterate System.out.println(row1.newColumn) returns the values I wanted.

Red1
Contributor
Contributor
Author

Can I see how you configured tJava_3?  What java does it contain? Are you using java to control it's Iterate flow?  

Anonymous
Not applicable

I am doing nothing there, tjava is what it is. tJava is just a placeholder here. It cannot pass anything across but continue a flow. The behavioral benefit of using the iterate function is the ability to capture the row information coming out of your input. Again, this can be achieved using other components. The behavior is part of Talend and the java code it generates. You may be overcomplicating things.

What are you trying to achieve with this?

Anonymous
Not applicable

0683p000009Lrkw.png