DataMapper Scripts API

This page describes the different features available in scripts created inside DataMapper. See Using scripts in the DataMapper.

Objects

Name Description Available in scripts of type
automation A ScriptableAutomation object encapsulating the properties of the OL Connect Workflow process that triggered the current operation.

Boundaries, all steps except Goto

boundaries An object encapsulating properties and methods allowing to define the boundaries of each document in the job. Boundaries
data A data object encapsulating properties and methods pertaining to the original data stream. Boundaries, all steps except Goto
db An object that allows to connect to a database. Boundaries, all steps except Goto
logger An object that allows to log error, warning or informational messages. Boundaries, all steps except Goto
record The current record in the main data set. Extract, Condition, Repeat and Multiple Conditions steps
region An object that defines a subsection of the input data. Boundaries
sourceRecord An object containing properties specific to the current source record being processed. Boundaries, all steps except Goto and Postprocessor
steps An object encapsulating properties and methods pertaining to the current data mapping configuration. Extract, Condition, Repeat and Multiple Conditions steps

Functions

These functions are available in Boundaries and Steps scripts.

Name Description
copyFile() Copies a file to the target file path, replacing it if it already exists.
createGUID() Returns a unique 36-character string consisting of 32 alphanumeric, lower case characters and four hyphens (format: 8-4-4-4-12). Example: 123e4567-e89b-12d3-a456-426655440000.
createHTTPRequest() Creates a new HTTP Request Object.
createTmpFile() Creates a file with a unique name in the temporary work folder and returns a file object.
deleteFile() Deletes a file.
execute() Calls an external program and waits for it to end.

isRuntime()

Returns true if the data mapping process is currently running in runtime mode, or false if the configuration is running in debug mode (i.e. in the DataMapper).

newByteArray() Returns a new byte array.
newCharArray() Returns a character array.
newDoubleArray() Returns a double array.
newFloatArray() Returns a float array.
newIntArray() Returns an integer array.
newLongArray() Returns a long array.
newStringArray() Returns a string array.
openBinaryReader() Opens a file as a binary file for reading purposes.
openBinaryWriter() Opens a file as a binary file for writing purposes.
openTextReader() Opens a file as a text file for reading purposes.
openTextWriter() Opens a file as a text file for writing purposes.