views:

363

answers:

1

Hi to all!

This question is about Talend Open Studio code.

I use tSendmail component as a child job, that needs to be run when parent job fails (tFtpPut). However, in tFtpPut, file names are filtered by filename masks (for example, it will upload file named Eedoh, if I put Ee* as a mask), but in tSendMail that's not the case.

I understand that tFtpPut uses special characters from filesystem to make filename masks, and tSendMail should use Java regex. Problem is (as I saw in the source code), List.add(String) function is used to add filenames, so I can not use regex as parameter in .add function.

So, I need way to upload all files with names that match regular expression.

Btw, I've tried to change the source code (tried iterating the whole folder and adding all files whose names matches the regex), but it didn't help, an error ocured somewhere else and I was not able to track the issue.

A: 

For that problem, I would create a regexpr filter before the components (FTP and sendMail).

It is very easy with a tFilterRow component in "advanced mode". Your filter condition is "inputrow.filenamefield.matches("java_regexpr")".

This external filter is the same for both components and you don't have anymore to use the specific filter of the FTP component.

Benoit Courtine