[resolved] tJavaFlex auto propagation

One Star

[resolved] tJavaFlex auto propagation

Hi,
Here is my question :
I had to read a table and put the rows into 2 Output XML files. I did the following :
tAS400Input => tMap => tAdvancedFileOutputXML
=> tAdvancedFileOutputXML_2
It worked fine.
Now I have to change my job because the first tAdvancedFileOutputXML only has to receive the first row of the table and the second tAdvancedFileOutputXML still receives all rows.
As the table doesn't have any primary key (and I can't change it) I thought of adding a tJavaFlex with a counter and put a restriction in the tMap for the first tAdvancedfileOutputXML.
I wanted to use a tJavaFlex in order to use the "auto propagation" option.
My job now looks like this :
tAS400Input => tJavaFlex => tMap => tAdvancedFileOutputXML
=> tAdvancedFileOutputXML_2
In my tJavaFlex I have the following :
Begin code :
int i=1;
Main Code :
outputLink.counter = i++;
End Code :
<nothing>
I checked the "Auto Propagation" check box option in the tJavaFlex component.
The problem is that the counter value in the tMap is set to 1 for every row... I don't understand why...
I could find a "workaround" by changing the tJavaFlex as the following :
Begin code :
int i=1;
Main Code :
outputLink.name = inputLink.name;
outputLink.firstname = inputLink.firstname;
(... and so on)
outputLink.counter = i++;
End Code :
<nothing>
and NOT checking the "Auto Propagation" check box.
This solution works fine but I don't understand why I have to write the outputlink.columname = inputlink.columname as I thought that the auto propagate check box was created to avoid this.
Thank you in advance for your help

Accepted Solutions
Community Manager

Re: [resolved] tJavaFlex auto propagation

Hello
Which version of TOS do you use? It was a bug on 3.x version, it works fine on version 4.x.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

All Replies
Community Manager

Re: [resolved] tJavaFlex auto propagation

Hello
Which version of TOS do you use? It was a bug on 3.x version, it works fine on version 4.x.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: [resolved] tJavaFlex auto propagation

TOS 3.2.3 ... I use it because I'm also using the Datastage to Talend convert which doesn't work on TOS 4.x
Thanks for your answer!