3 tJavaFlex to 1

Five Stars

3 tJavaFlex to 1

Hello,

image.png

I want to use 1 tjavaflex instead of 3,
I tried treplicate but it didn't work.
the objective is to do several mapping

 

Thank you

Sixteen Stars

Re: 3 tJavaFlex to 1

What are you doing inside the tJavaFlex components? They seem to produce a different number of rows, so I assume you are doing very different things. Why do you want to use 1 instead of 3? I need a bit more info

Five Stars

Re: 3 tJavaFlex to 1

Thanks,

 

in tjavaFlex1:

 

Bak bak = BakReader.getInstance().read("D:\\test.bak", "utf-8"); 

int i = 0;

for (Tow tow : bak.getDon().getTows()) {

i++;
row.nbSets = i + " - nb sets : " + tow.getNbSets();
row.cur=tow.getCur();

}

in tjavaflex2:

Bak bak = BakReader.getInstance().read("D:\\test.bak", "utf-8"); 

int i = 0; 
for (Cable cable : bak.getDon().getCables()) {

i++;
row1.cur1=cable.getCur();
row1.numero=cable.getNumero();

}

 

in tJavaFlex 3: 

 

Bak bak = BakReader.getInstance().read("D:\\test.bak", "utf-8"); 

for (Tow tow : bak.getDon().getTows()) {

for (Set set : tow.getSets()) {
row2.cur2=tow.getCur();
	row2.numeroSet=set.getNumero();
System.out.println( tow.getCur()+ " : " + set.getNumero());
}}

l'objectif est d'avoir lu le fichier test.bak une seule fois.

 

Thanks

 

Sixteen Stars

Re: 3 tJavaFlex to 1

The code seems to suggest it will be possible to cram it all into a single tJavaFlex, but given your job layout I am confused as to how this will be useful. You have 3 (I'm assuming) arrays you getting data from. I'm also assuming there will not be the same number of rows for each array. Why not read the file once and put the data into the globalMap like this.....

 

Bak bak = BakReader.getInstance().read("D:\\test.bak", "utf-8"); 
globalMap.put("bak", bak);

Then whenever you want to read it, you simply retrieve it from the globalMap like this....

Bak bak = ((Bak)globalMap.get("bak")); 

Of course, you can merge your code to all be in one tJavaFlex, but you will have to understand how the data fits together to do that.

One last thing, your code below seems to show your loops in one location. I take it you are using the tJavaFlex with the loop started in the Start Code section, the body of the loop in the Main Code section and end of the loop in the End Code section?

Five Stars

Re: 3 tJavaFlex to 1

One last thing, your code below seems to show your loops in one location. I take it you are using the tJavaFlex with the loop started in the Start Code section, the body of the loop in the Main Code section and end of the loop in the End Code section?

 

exactly