2018.2

Table Of Contents
Example
In the following script, the contents of the data sample file are copied in uppercase to a
temporary file.
try{
// Open a reader
var reader = openTextReader(data.filename);
// Create a temporary file
var tmpFile = createTmpFile();
// Open a writer on the temporary file
var writer = openTextWriter(tmpFile.getPath());
try{
var line = null; // Current line
/* read line by line and readLine will return null at the end of
the file */
while( (line = reader.readLine()) != null ){
// Edit the line
line = line.toUpperCase();
// Write the result in the temporary file
writer.write(line);
// add a new line
writer.newLine();
}
}
finally{
// Close the writer of the temporary file
writer.close();
}
}
finally{
// Close the reader
reader.close();
}
deleteFile(data.filename);
tmpFile.move(data.filename);
createHTTPRequest()
Function that creates a new ScriptableHTTPRequest object, in order to issue REST/AJAX calls
to external servers.
This feature allows the data mapping process to complement its extraction process with
external data, including data that could be provided by an HTTP process in Workflow, for
Page 360