Search code examples
etltalend

Talend : "main link" does not work before a SubJob for retrieving value from it


I have a problem with my Talend job. My objective is to start from a list of persons (extracted from a database) and for each line in the list check if the ID already exists in the Active Directory.

The subjob (cherche_doublon_id) whose check if the ID already exists work fine. The job should return a result "idUnique" if the ID does not exist, and "idDoublon" in the othe case. This subjob use the ID which is transmitted by the parent as context parameter.

My problem seems to be the connection "main" whose enter in my child job. If I put a "OnComponentOk", the subjob work well, but only one time on the latest element of my list. With the "main" connection, I wanted to execute the subjob for each line in my list, but I can not retrieve the result on the job.

Here you can find my job and the settings of the components: my job and the settings of the components

If I do with a "OnComponentOk" link before the subjob, I can retrieve without any dificulties. See the corresponding screenshot: See the corresponding screenshot

But in my case, "OnComponentOk" cannot be viable because I want to do my stuff for each line in the liste.


Solution

  • Finally I solved my problem by changing the structure of my jobs. In my initial question, I tried to retrieve te result of my first job "cherche_doublon", and I wanted to filter on this result.

    Now I decided to work in cascade mode.

    That means I have my first job : liste_titulaires → affect_global → cherche_doublon

    And inside my cherche_doublon, I do my stuff, and at the end in fonction of my result I do the one or the other job : Here the image of the subjob

    I have other sub sub jobs. The good point is that in my main job, I iterate on each element of my list and all the treatment inside my subjobs is done. I use context parameters to transmitt the information I nead.

    All is working fine now. Thank you for your help.

    Damien.