title: How to dynamically pass filename to tFTPRename in Talend?
body: <p>I currently have a job that works like this:</p>
  
  <p>tPrejob-->tOracleConnection1--->tOracleConnection2--->tSetGlobalVar1(timestamp)--->tRunjob(runs prejob to gather file from FTP)</p>
  
  <p>Then there is a tPostjob that is supposed to rename the processed file on the FTP server.</p>
  
  <p>tPostjob--->tFTPRename</p>
  
  <p>It should be renaming the file with <code>"File Processed On " + ((String)globalMap.get("timestamp")) + "This is where I would put the orginal file name"</code></p>
  
  <p>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: </p>
  
  <blockquote>
    <p>"Exception in component tFTPRename_1 java.lang.NullPointerException"</p>
  </blockquote>
  
  <p>I've tried several methods for passing the file name into the tFTPRename component, but none are working.</p>
  
  <p>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 <code>((String)globalMap.get("FileName"))</code>, but had no luck.</p>
  
  <p>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.</p>
  
  <p>Main Job:
  <img src="https://i.stack.imgur.com/teleh.png" alt="Main Job">
  PreJob:
  <img src="https://i.stack.imgur.com/CFfuf.png" alt="PreJob">
  tFTPRename Component:
  <img src="https://i.stack.imgur.com/3y0YI.png" alt="tFTPRename Component">
  tFileInputFullRow:
  <img src="https://i.stack.imgur.com/nOdgZ.png" alt="File Name Read"></p>