Skip to content

Resolving File Names

Martin Danielsson edited this page Jul 22, 2015 · 1 revision

Resolving existing file

NFT will always try to resolve file names, from all

  • Configuration files
  • Operators

using the following strategy:

  1. From the current directory, is the file accessible? (e.g. file://static_mapping.csv)
  2. If not, is the path an absolute path? Is it accessible? (e.g. C:\Mappings\this_and_that.csv)
  3. If it's a relative path, append it to the path of the configuration file and try to access it?

Example: A configuration file for the Salesforce Reader is defined in the following source definition:

<Transformation>
  ...
  <Source config="..\..\config\§env§\sfdc_config.xml">soql://select Id, FirstName, LastName from Contact</Source>
  ...
</Transformation>

NFT will recognize that it's a relative path, and, assuming the absolute path to the current configuration file is C:\Work\MyProject\entities\Contacts\read_contacts.xml, NFT will search for the configuration file for Salesforce sfdc_config.xml in the following location: C:\Work\MyProject\config\§env§\sfdc_config.xml. Note the use of the parameter §env§ here; this is obviously optional, but having different configuration files for different environments (like Dev, Test and Prod) is good practice.

Resolving file names for writing to files

This is when resolving for existing files; when creating files, e.g. using the FileTextWrite Operator or for the CSV Writer, the following strategy is used:

  1. If it is an absolute path, use that (e.g. file://C:\Temp\output.xml)
  2. Otherwise, append the relative path to the path of the configuration file (e.g. file://..\output\this_and_that.xml).
Clone this wiki locally