tMemorizeRows

One Star

tMemorizeRows

Hi!
I have used tMemorizeRows component and it works pretty well to get the previous row. Thanks Garrett and cantoine I have installed new version 4.2.0
I have used a tJavaFlex, tIterateFlow and tJavaRow to convert the OBJECT into INTEGER and to be able to insert output of tjavaRow to tMAP as a row.

tMSSqlInput--->tMemorizeRows--->tJavaFlex---->tIterateFlow----->tJavaRow
The code used in tJavaFlex:
Start:
int i=0;
java.util.List<Integer> list=new java.util.ArrayList<Integer>();
Main:
list.add(j1708_idle_time_tMemorizeRows_1);
globalMap.put("list",list);
End:
Left it Blank

tIterateFlow:
globalMap.get("CURRENT_FILE")
tJavaRow:
java.util.List<Integer> retriveList = (java.util.List<Integer> )globalMap.get("list");
int k=0;
int i=0;
for ( Integer l : retriveList){
k= retriveList.get(i)==null?0:retriveList.get(i);
System.out.println(i);
System.out.println(k);
i++;
}

tJavaRow is getting the Object as Integer rows as many times as there are rows in tMSSqlInput.
How to get values in tJavaRow ones and pass on values to tMap as row.

Regards,
Srivani

Re: tMemorizeRows

in a tJavaRow you can use special syntax:
use
input_row.column
and
output_row.column
in a tJavaFlex you need to reference the connected row explicitly
One Star

Re: tMemorizeRows

Hi!
Can you pls elaborate .
I have made following change to tJavaFlex:How to reference connected row explicitly?
int i=0;
j1708_idle_time.add(j1708_idle_time_tMemorizeRows_1);
globalMap.put("list",j1708_idle_time);
System.out.println(j1708_idle_time);

When I use Input_row and output_row in tJavaRow it gives an error that Output_row cant be resolved into a variable.
Regards,
srivani

Re: tMemorizeRows

Hi!
Can you pls elaborate .
I have made following change to tJavaFlex:How to reference connected row explicitly?

If you have tFileInput--row1-->tJavaFlex--row2-->dbOutput
in the tJavaFlex you would get incoming rows with:
String column = row1.column;
You would assign output rows with something like:
row2.column = "I got me some data";
int i=0;
j1708_idle_time.add(j1708_idle_time_tMemorizeRows_1);
globalMap.put("list",j1708_idle_time);
System.out.println(j1708_idle_time);

When I use Input_row and output_row in tJavaRow it gives an error that Output_row cant be resolved into a variable.

Case matters-- output_row should be all lower.
Also, if you dont have the component set up with row input and output you wont be able to reference the rows:
tInput --row1-->tJavaRow--row2-->tDBout
here, in a tJavaRow, "input_row" will be rewritten as "row1"
"output_row" will be rewritten as "row2"
if the tJavaRow is not connected, then the input_row/output_row vars wont be overwritten and you'll get an exception.