External script variables

You can define and modify script variables that you can reference from script. Since script variables are stored in an external XML file, you can modify their value by editing the file. The XML file is located in the root of the project directory and is called as follows: <Project Name>_ScriptVariables.xml.

You can add or delete variables and change their values within the Transformation Designer using the Script Variables window. Alternatively, you can edit the XML file directly without needing to change the project.

Here is a sample XML file for the defined script variables ScriptLogPath and EnableLogging:

<?xml version="1.0" encoding="UTF-8"?> 
<KTM>
   <ScriptVariables>
      <ScriptVariable key="ScriptLogPath" value="C:\Logs"/>
      <ScriptVariable key="EnableLogging" value="TRUE"/>
   </ScriptVariables>
</KTM>

For example, you can call the function during processing to log script errors.