Bi-Dimensional string array - Routine output to tJavaRow

Five Stars

Bi-Dimensional string array - Routine output to tJavaRow

Hello,

I'm facing an issue passign a multi dimensionall array from routine output to tJavaRow.

Scenario:

  • I've defined a routin with bi-dimensional string :

 

public static  String [][] post_text_login

 

  • In my routine I've several "for" nested cycles, setting array values on specific step:
for(int i=0;i<posts.size();i++)
        {
        	post_text[i] = posts.get(i).getElementsByClass("xxxt").text();
        	post_photo[i] = posts.get(i).getElementsByClass("_5dec _xcx").attr("data-ploi");
        	post_DT[i] = posts.get(i).getElementsByTag("abbr").attr("data-utime");
        };
        for(int j=0;j<posts.size();j++)
        {
        	ret_link[j][0]= post_text[j];
        	ret_link[j][1]= post_photo[j];
        	ret_link[j][2]= post_DT[j];
}
        
  • when I call the routine from the tJavaRow, loops are not working:
String [][]s =WebDriver_Selenium_3_8_1.post_text_login(x,x,x)

for(int i=0; i<10; i++) {
row14.post_text = s[i][0];
            row14.post_photo = s[i][1];
            row14.post_DT = s[i][2];
            row14.id_post = s[i][0];
 }

schema.JPG

 

How can I iterate trought the bi-dimensional array and cycle to rows?

 

Thank you

 

 

Community Manager

Re: Bi-Dimensional string array - Routine output to tJavaRow

You to use the tJavaFlex for this. The Start Code section would have this code in it....

String [][]s =WebDriver_Selenium_3_8_1.post_text_login(x,x,x)

for(int i=0; i<10; i++) {

....... the Main Code would have this code in it......

row14.post_text = s[i][0];
row14.post_photo = s[i][1];
row14.post_DT = s[i][2];
row14.id_post = s[i][0];

...... and the End Code would have this code in it....

}

.....yes, you just close the loop here.

You cannot generate rows from a tJavaRow, it just processes each row passed to it. To generate rows the only Java component to use is the tJavaFlex.
Five Stars

Re: Bi-Dimensional string array - Routine output to tJavaRow

Hello,

thx for the tip.

I still have issue understandign how to pass variable from previous componet to tJavaFlex:

 

error.JPG

This it the code in the start part of tJavaFlex:

String [][]s =WebDriver_Selenium_3_8_1.post_text_login(XXX,YYY,row12.line);

row12.line is always null.

Thx

 

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

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now