How to dynamically pass filename to tFTPRename in Talend?
I currently have a job that works like this: tPrejob-->tOracleConnection1--->tOracleConnection2--->tSetGlobalVar1(timestamp)--->tRunjob(runs prejob to gather file from FTP) Then there is a tPostjob that is supposed to rename the processed file on the FTP server. tPostjob--->tFTPRename It should be renaming the file with "File Processed On " + ((String)globalMap.get("timestamp")) + "This is where I would put the orginal file name" If I put a standard filename into the Filemask then it will run correctly, however if I try to make the filemask dynamic by passing the filename into it through globalMap.get then I get the Error: "Exception in component tFTPRename_1 java.lang.NullPointerException" I've tried several methods for passing the file name into the tFTPRename component, but none are working. I'm currently capturing the file name in the subjob and outputting it to a txt file and then using tFileInputFullRow on the main job to create that variable. I tried passing this into a tSetGlobalVar and then adding it into the filemask as ((String)globalMap.get("FileName")), but had no luck. I also tried several methods on the internet, but none of them worked, so I wasn't sure if it was me or if it has something to do with tFTPRename capabilities. Thanks in advance to anyone who could help! Main Job: http://www.talendforge.org/forum/img/members/190225/mini_MainJob.png_20140718-1611.png Sub-Job: http://www.talendforge.org/forum/img/members/190225/mini_Prejob.png.png tFTPRename Configuation: http://www.talendforge.org/forum/img/members/190225/mini_FTPconfige.png.png
Re: How to dynamically pass filename to tFTPRename in Talend?
I added the screenshots and as an update, I can pass the global variable into the tFileInputXML components and have them read the file name being produced by tFlowtoIterate. So I'm thinking it is either a limitation of tFTPRename or something I have wrong in that component?