I could solve it using tMemorizeRows, saving the whole mapping table to memory using a tJavaFlex and then reading them using a routine.
What i did was, memorize the whole table, i only had one table, with three columns, the first indicating the type of mapping i had to do, the second being the original code, and the third one being the replacement code.
Once memorized the data, i used a tJavaFlex to create three lists, one for each column and then move those lists to the global variables map.
Then i created a routine that receives all three lists plus two codes, the first one is the mapping name (first column filter) and the second one is the original code (second column filter). Using both i could pinpoint the position of the replacement code, and return it.
Finally, when reading the main flow of data, using a tMap, i created a variable for each distinct value of the first column (that is, one for each type of mapping) and then called the routine i developed using the oriinal code + the mapping name.
The code i used in the tMemorizeRows was:
START CODE
java.util.Set<String> iLista;
java.util.List<String> lLOV=new java.util.ArrayList<String>();
java.util.List<String> lS6=new java.util.ArrayList<String>();
java.util.List<String> lS8=new java.util.ArrayList<String>();
MAIN CODE
lLOV.add(LOV_tMemorizeRows_1[icount]);
lS6.add(S6_NAME_tMemorizeRows_1[icount]);
lS8.add(S8_NAME_tMemorizeRows_1[icount]);
END CODE
globalMap.put("lLOV",lLOV);
globalMap.put("lS6",lS6);
globalMap.put("lS8",lS8);
ROUTINE CODE
/*
* Toma los valores generados de la LOV y matchea con S8, requiere la ejecucion del job
* Genericos\GeneradorLOV
*
* {talendTypes} String | String
*
* {Category} MigracionDatos
*
* {param} string(entrada.LOV) Identifica el tipo de LOV
*
* {param} string(entrada.S6_NAME) Indica el valor del campo en Siebel 6
*
* {param} ((java.util.List<String>) globalMap.get("lLOV"))
*
* {param} ((java.util.List<String>) globalMap.get("lS6"))
*
* {param} ((java.util.List<String>) globalMap.get("lS8"))
*
*/
public static String calculaLOV(String CampoLOV, String CampoS6, java.util.List<String> listaLOV, java.util.List<String> listaS6,java.util.List<String> listaS8 ) {
/*
* java.util.List<String> listaLOV = ( java.util.List<String>) globalMap.get("lLOV");
* java.util.List<String> listaS6 = ( java.util.List<String>) globalMap.get("lS6");
* java.util.List<String> listaS8 = ( java.util.List<String>) globalMap.get("lS8");
*/
String C1 = CampoLOV;
String C2 = CampoS6;
int posicionC1 = listaLOV.indexOf(C1);
// encontró el LOV
if(posicionC1 >= 0) {
java.util.List<String> listaS6_Iterada = new java.util.ArrayList<String>();
// Genera la lista intermedia con los valores
for (int contador = posicionC1; contador < listaLOV.size() ; contador++) {
listaS6_Iterada.add(listaS6.get(contador));
if(!listaLOV.get(contador).toString().equals(C1)) {break;}
}
int posicionC2 = listaS6_Iterada.indexOf(C2);
if(posicionC2 >= 0) {
int posicionFinal = posicionC1 + posicionC2;
return listaS8.get(posicionFinal);
} else {
return "";
}
} else {
return "";
}
}