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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

make one of tJava components act as Input component

How to make a java component with a loop that GENERATEs rows?
tJava, tJavaRow, tJavaFlex seem to be transit components only. They don't have their own loop and they need input and output.
Worst of all, the input and output row variables must already exist to do something like in the example:
output_row.name = input_row.name.toLowerCase();

It means that trying to make a 'dry run' on them will cause something like "output_row undefined"
Labels (3)
8 Replies
Anonymous
Not applicable
Author

You can use the tJavaFlex and open your loop in the begin part.
You will close the loop in the end part.
HTH,
Anonymous
Not applicable
Author

this causes tos to make a broken process function with many undeclared vars, uncaught exceptions and unaligned code
Anonymous
Not applicable
Author

Will tRowGenerator work for your job?
You don't provide any details so it's hard to tell what you are trying to do. You can use some degree of custom code in the environment part, just set function to "..." first. Generate one row at a time and hook it up to a tloop component, if necessary use context variables and a tjava component to set them.
Anonymous
Not applicable
Author

I've never had problems using a tJavaFlex or tPerlFlex to create input flows. Can you provide some of the code you are using? My first guess is that you do not have code of the correct form to use in a t*Flex component.
alevy
Specialist
Specialist

If not tRowGenerator (which populates fields using randomly selected values from your defined set of possibilities), tLoop followed by tIterateToFlow? If you need more complicated value assignments than can reasonably be included in tIterateToFlow's value field, put a tJava in between and assign your values to a globalMap variable that you then use in tIterateToFlow.
Anonymous
Not applicable
Author

You can use the tJavaFlex and open your loop in the begin part.
You will close the loop in the end part.
HTH,

http://www.talendforge.org/bugs/bug_view_advanced_page.php?bug_id=13800&history=1
looks like after installing the patch from there I can do as mhirt advised
Anonymous
Not applicable
Author

What if I create multiple copies of tJavaFlex component? Would I need to change 'row1' to 'row2','row3' and so on in the main code box?^W nvm
Anonymous
Not applicable
Author

No you will not have to change your t*flex code, if you use "row.value" (java) or "$row" (perl) talend will re-write the code for you as row1,row2 etc...