Sepasoft MES Module Suite
exportConfiguration(...)
Overview
Exports MES definition objects from the gateway database into a single pretty-printed JSON file. The snapshot includes object core fields, complex properties (including artifact payloads), custom properties, parent/child links, enum option metadata, the Production module version, and a list of installed Sepasoft modules. Use it for backups, environment promotion, and CI/CD configuration management.
Syntax
Python |
system.mes.exportConfiguration() system.mes.exportConfiguration(filePath) |
Parameters
Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
filePath | String | Optional | (see Location) | Absolute or relative path for the JSON file on the gateway host. When omitted, the file is written under the gateway Ignition data directory. |
Return Value
Type | Description |
|---|---|
None | The function performs a side effect (writes a file) and does not return a value. |
Exceptions
Failures propagate as script exceptions. Common causes include filesystem errors when opening or writing filePath (permissions, missing parent directory, invalid path), analysis-database errors while reading definition rows, or errors decoding artifact payload bytes (see Artifact decode failures below).
Location / Paths
Default file: {IgnitionDataDirectory}/MESConfig.json, where IgnitionDataDirectory is the gateway’s data directory from Ignition’s system manager (typically the main Ignition data folder for that gateway).
Custom path: Any path you pass is opened with a file writer on the gateway. From Designer or a client session, paths refer to the gateway filesystem, not the machine running the Designer or session.
Scope / Availability
Registered on the system.mes script module (Sepasoft Production / MES).
Gateway: Executes locally and writes the file on that gateway.
Designer / Client: Invokes the same API; execution and file I/O occur on the connected gateway via RPC.
Exported / Included Data
Definition objects: All MES object types whose kind is definition, for which the corresponding module is installed, processed in parent-before-child order. Each object includes stored core columns, complex property rows, custom property rows, and parent/child link structures used for configuration graphs.
Metadata: Export timestamp, module version string, approximate export duration (executionTime), and a map of enum UUIDs to friendly names used when denormalizing values in the JSON.
Installed modules: Module info entries for gateway modules whose hooks are under the com.sepasoft package namespace.
Excluded / Edge Cases
Object types omitted entirely: BatchStates and MaterialRoot are not included in the export set.
Runtime / non-definition data: Objects that are not definition-kind (for example runtime instances) are not part of this export.
Module gating: Types belonging to modules that are not installed on the gateway are skipped.
Artifact complex properties: For artifacts, the export joins the latest artifact version and decodes stored artifact bytes into text in the JSON.
Artifact decode failures (optional JVM flag)
Artifact bytes are deserialized on the gateway using Java ObjectInputStream with a strict ObjectInputFilter (allow list and resource limits). If export fails while processing artifacts—often with messages involving ObjectInputFilter, InvalidClassException, or similar—and your data is legitimate but uses types or object graphs the filter rejects, support may ask you to disable that filter on the gateway by adding a JVM argument in ignition.conf (use the next free wrapper.java.additional.N index):
Python |
wrapper.java.additional.11=-Dcom.sepasoft.unsafe.disableObjectInputFilter=True |
Restart the gateway after changing ignition.conf. This reduces deserialization hardening; use only when needed to complete export, not as a default.
Example Usage
Minimal example
Python |
system.mes.exportConfiguration() |
Complex example
Python |
# Write to an explicit path on the gateway (e.g. shared drive or staging folder). system.mes.exportConfiguration("C:/MESExports/prod-snapshot.json") # Default path: Ignition data directory + MESConfig.json system.mes.exportConfiguration() |
Related Functions
importConfiguration() — Imports MES configuration from a JSON file produced by this export (default path matches the export default when no argument is given).
importConfiguration(filePath) — Same as above using a specific file on the gateway.
truncateConfiguration() — Clears configuration tables; often used in controlled restore workflows before import.
Sepasoft MES Module Suite