make one of tJava components act as Input component

One Star

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"
Employee

Re: make one of tJava components act as Input component

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

Re: make one of tJava components act as Input component

this causes tos to make a broken process function with many undeclared vars, uncaught exceptions and unaligned code
One Star

Re: make one of tJava components act as Input component

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.

Re: make one of tJava components act as Input component

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.
Seven Stars

Re: make one of tJava components act as Input component

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.
One Star

Re: make one of tJava components act as Input component

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
One Star

Re: make one of tJava components act as Input component

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

Re: make one of tJava components act as Input component

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...