add to data flow using tjavaflex

One Star

add to data flow using tjavaflex

Hello, how can i add rows inside tjavaFlex or twebserviceinput java tab?
Moderator

Re: add to data flow using tjavaflex

Hi dudum,
What's your job requirement? Do you want variable value in parameters of tWebserviceInput from previous component(tjavaflex)?
Can you please explain your request with some example data so that we can give you more accurate answers.

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: add to data flow using tjavaflex

Well , I have tjavaflex component and i want to generate new output rows (flow),from the java code.
what i mean it is not based on input component, just generate them in the code and output as flow
Seventeen Stars

Re: add to data flow using tjavaflex

hi,
try something like :
output_row.yourfield =  your calculed value (calling a routines or not);


regards
laurent
Community Manager

Re: add to data flow using tjavaflex

You can do this in a simple way by doing something like the following.....
Start Code
for(int i = 0; i<10 ; i++){

You are opening a FOR loop here, but not closing it.

Main Code
row1.column1 = "Column1";
row1.column2 = "Column2";
row1.column3 = "Column3";

You are creating your data row here. I am assuming an output row named "row1" and a schema with the columns used above.
End Code
}

You are closing the FOR loop here.
If you plug that in, you will generate 10 rows of data.
Seventeen Stars

Re: add to data flow using tjavaflex

right rhall,
output_row.yourfield

is syntax for tJavaRow (never understood why 2 differents ways) Smiley Wink
Community Manager

Re: add to data flow using tjavaflex

I always get caught out kzone. It should just use the input and output row names as far as I am concerned.
Seventeen Stars

Re: add to data flow using tjavaflex

i like the way " input_ & output_ syntax"  ...  they are independant of the name's flow (and the fact that propagation not always efficient Smiley Wink
regards
laurent
One Star

Re: add to data flow using tjavaflex

so the number of loops i make in the start row , the flow output will be?
Community Manager

Re: add to data flow using tjavaflex

If you set the loop to iterate 10 times, you will get 10 rows generated.

Calling Talend Open Studio Users

The first 100 community members completing the Open Studio survey win a $10 gift voucher.

Start the survey

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

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch