Hi,

I am having some struggles in understanding the behaviour of the method setVariable when used in Script Value component. Variable scopes are nicely described here
but I have some problems when re-running the transformation where it seems that the variable is reused from the previous run. Here is the snippet from the component:

Code:
var filenameList = getVariable("FILENAME_LIST","");

// Add first filenam
if(isEmpty(filenameList)){
     filenameList = inputFilename+ ";" +outputFilename;
// Add additional filenames
}else{
     filenameList += "\n"+inputFilename+ ";" +outputFilename;
}

writeToLog("FileList: "+filenameList);


// Set variable up-to the root job
setVariable("FILENAME_LIST",filenameList,"r");