Search code examples
sqloracletalendtalend-mdm

talend - tMap output into list


I have the following flow:

                                  tOutputFile (will output many fields)    
                                   /   
tOracleInput ->  tMap -> tReplicate
                                   \
                                  tMap (will only map the reference field)
                                     \
                                     tUniqRow (only unique reference field)
                                       \
                                     tSetGlobalVar 
                                        (and add to globalMap as a list--???)

   | (on subjob ok)
   |
   |
   |
   |
  \ /

tOracleInput  -------------------> tMap -------------------> tOutputFile
(filter where clause
with references from globalMap list)

But I'm at lost on how can I go about to put the output of tUniqRow to tSetGlobalVar? (The ??? above) Or if not tSetGLobalVar, I can use tJava to put it in globalMap, but how can I get the output of tUniqRow in code level?

Can anyone enlighten me regarding this?

Thanks a lot!


Solution

  • Use tJavaflex after tUniqRow component.

    --->tUniqRow---row1(uniques)-->tJavaFlex

    -> In start code of tjavaFlex initialize a list : List list = new ArrayList();

    -> In main code of tJavaFlex add your tuniqRow flow to list variable : list.add(row1.yourColumn);

    -> In end code of tJavaFlex add the list variable to globalMap : globalMap.put("KeyName",list);

    Access this map using "keyName" anywhere.

    Hope this helps..