Scripting and transformation
Where an external format does not line up with the data entity behind a port, Outbridge transforms it. Transformation is defined per port and direction, edited in a code editor inside Finance and Operations, and executed under limits you control.
Format mapping #
A Format mapping defines how an incoming or outgoing payload is converted for one port.
To open it, go to Modules > Outbridge > Data integration > Data ports > Data ports, select the port, and open its format mapping.
A mapping record holds:
- Port and Direction—the port and the direction the mapping applies to.
- Incoming type—the external format: Json, Xml, Plain text, or HTML. JSON payloads are converted to XML before transformation, so a single stylesheet handles both.
- Entity—the data entity the transformed content is loaded into or extracted from.
- XSLT Script—the stylesheet that performs the transformation.
Transformation is available only where the port's data processor supports it. Each processor class declares whether it supports inbound and outbound transformation; if the option is unavailable on a port, check its data processor. See Configure a Data processor.
The editor #
Scripts are edited in an embedded code editor with syntax highlighting, and the editor's behavior is configurable per user—language, theme, word wrap and wrapping indent, line numbers, bracket auto-closing, and scrollbar visibility. Available languages include Plain text, JavaScript, TypeScript, JSON, HTML, CSS, Python, SQL, YAML, XML, and CSV.
The editor holds up to 4,194,304 characters. Content above that is not sent to the server: the editor reports how long the content is against the limit and leaves the saved value untouched, so nothing is silently truncated. Reduce the content and save again. A stylesheet or script approaching this size is usually a sign that data has been pasted into it; keep sample payloads in the diagnostics console instead.
Execution limits #
Script execution is bounded by two settings in Modules > Outbridge > Setup > Outbridge parameters, on the Scripting section of the General tab:
- Script memory limit (MB)—the maximum memory available to one script execution.
- Script timeout (s)—the maximum time allowed for one script execution. A script that exceeds this is stopped.
These protect the environment from a script that loops or allocates without bound. A transformation that legitimately needs more than the configured limit should be simplified or moved into the data entity, rather than having the limits raised for every script in the environment.
Engines #
- XSLT transformations are executed by the DAXon engine. The measured cost of a transformation includes parsing the input and looking up or compiling the stylesheet; compiled stylesheets are cached per process, so the first execution after a restart is slower than the rest.
- PyLite executes Python scripts. It reads the payload and returns a result.
Both engines can be measured in a specific environment with the diagnostics console.
Diagnosing a failing script #
Script problems appear in the execution log under two stages:
- Script execution—the script itself ran and failed. The log entry carries the failure detail.
- Transform—the transformation step. A stylesheet that produces no output, or output the data entity rejects, surfaces here or in the following DMF Import stage.
Where a snapshot was retained, the payload the script received and the output it produced can be inspected directly. See Snapshot viewer. This is normally faster than reasoning about the stylesheet: most transformation failures are caused by the input not being shaped the way the stylesheet assumes.