2018.1

Table Of Contents
// 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
instance a process that retrieves certain values from Workflows Data Repository. Another
possible use is to have a Postprocessor that writes the results of the extraction process to a file
and immediately uploads that file to a Workflow process.
The returned ScriptableHTTPRequest has a selection of the properties and methods of the
standard JavaScript XMLHTTPRequest object (see https://developer.mozilla.org/en-
US/docs/Web/API/XMLHttpRequest). Supported properties and methods are listed below.
Page 347