Manage error from tFileList

One Star

Manage error from tFileList

I have a number of subjobs that need to be run in sequence (screenshot attached). These are very minor operations that are simply error checks & logs. For the first Subjob, tFileList_2 searches an error directory for files and then tFileRowCount_1 only writes to my error table if the # of rows in the file is >10.
The problem i'm having is that if there are no errors, no files are generated so tFileRowCount_1 throws back a null pointer exception. I don't know why the iteration even starts if there is a null value returned from tFileList_2 but that's a different issue. To fix this I added an OnComponentError to write to my log table and set the flag on tFileList_2 to error out if no files are found. The problem now is that it correctly writes to my log table to indicate there are no errors but after that the job simply exits without continuing down to the other subjobs.
Is there a way to make sure the error is captured but the job continues? If not is there another workaround that anyone can suggest (other than creating a new job for these 3 components).
Community Manager

Re: Manage error from tFileList

Hello
Uncheck the 'Generate error if no filed found' option, otherwise it will end the job.
You can use the global variable:
((Integer)globalMap.get("tFileList_2_NB_FILE"))
it counts the number of files found. see my screenshots
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Manage error from tFileList

If i connect the filelist and rowcount components with a Run If, will it still iterate through the files if they exist?
One Star

Re: Manage error from tFileList

nevermind, i just saw your attachments. Thanks!
Community Manager

Re: Manage error from tFileList

Hello
If i connect the filelist and rowcount components with a Run If, will it still iterate through the files if they exist?

Don't link rowcount cmponents with runIf link, In my demo job, I show how to fire the tOracleRow component and don't exit the job if there are no files found.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business