Script Management
Script Management maintains runtime scripts used by configured variables, memory calculations, forwarding templates, dynamic database storage, and MQTT RPC. A saved script takes effect only after it compiles successfully.
This page explains the Web operation workflow. For script syntax, available types, and complete examples, see Script Development Reference.
Key Terms
| Term | Description |
|---|---|
| Local script | A script saved in the current project. It can be edited, compiled, or deleted. |
| Loaded script | A compiled script currently available to runtime configuration. |
| Compile | Checks whether the script can be loaded and used by GatewayRuntime. |
| Category | A label used to group and filter scripts. |
| Input parameter | A configurable value exposed by the script, such as a threshold or scale factor. |
Navigation
Log in to GatewayRuntime Web and open Development Configuration → Script Management.

Page Layout
| Area | Description |
|---|---|
| Local Scripts | Lists scripts saved in the current project and provides create, edit, compile, delete, and batch operations. |
| Loaded Scripts | Shows scripts currently available to runtime configuration. Use this tab to confirm that a compilation result has been loaded. |
| Category filter | Filters scripts by category. |
| Search | Searches by script name. |
| Toolbar | Provides create, batch compile, batch delete, and refresh actions. |
List Fields
| Field | Description |
|---|---|
| Selection | Selects scripts for batch compilation or deletion. |
| Name | Script name used by configuration selectors. |
| Category | Script grouping label. |
| Type | Intended runtime use of the script. |
| Updated time | Time of the most recent save or compilation. |
| Actions | Edit, compile, or delete the selected script. |
Create a Script
Click the create button and complete the creation dialog.

| Field | Description |
|---|---|
| Script type | Select the intended use. The available editor and parameter fields change with the selected type. |
| Name | Required and unique in the current project. Use a stable business-oriented name. |
| Category | Optional grouping label for search and maintenance. |
After creation, the script editor opens automatically.
Script Types
| Type | Typical use |
|---|---|
| Data transformation | Converts collected values before they are stored or forwarded. |
| Memory variable calculation | Calculates a memory variable from other runtime values. |
| Dynamic model | Produces a custom forwarding object from variable, device, alarm, or plug-in event data. |
| Dynamic SQL | Controls custom database table or write behavior. |
| MQTT RPC | Processes an MQTT message and prepares the agreed response. |
| Full source | Advanced extension option. Confirm its runtime and maintenance impact before use. |
Select the type required by the target configuration. Do not change an existing script to an unrelated purpose merely because the editor accepts the content.
Script Editor
The editor contains a top action bar, an editing area, and a bottom information panel.

| Area | Description |
|---|---|
| Back | Returns to the script list. Compile and save required changes before leaving. |
| Undo / redo | Reverts or reapplies recent editor changes. |
| Compile and save | Compiles the current content. A successful result is saved and loaded for runtime use. |
| Editing area | Maintains the current script content. |
| Bottom panel | Shows compilation messages, script information, and input parameters. |
Bottom Panel
| Tab | Description |
|---|---|
| Compilation log | Shows errors, warnings, and successful compilation output. Select a diagnostic item to locate the related editor position. |
| Script information | Maintains the script name and category. |
| Input parameters | Maintains configurable values exposed to the script. |
Input Parameter Fields
| Field | Description |
|---|---|
| Name | Parameter identifier. Keep it stable after the script is referenced. |
| Display name | Label shown in configuration pages. |
| Type | String, Boolean, integer, decimal, or another supported value type. |
| Default value | Value used when a configuration does not provide an override. |
| Description | Operational meaning, unit, valid range, and safety notes. |
Compilation Log
Click Compile and Save and review the Compilation Log tab.

| Message | Meaning |
|---|---|
| Compilation started | A new compilation has started for the displayed script. |
| Error | The script cannot be loaded. Resolve the first error before reviewing dependent messages. |
| Warning | Compilation may continue, but the warning should be reviewed before deployment. |
| Compilation succeeded | The current script passed compilation and is available for loading. |
After a successful compilation, return to the list and refresh Loaded Scripts to confirm that the expected name and type are present.
Common Operations
| Operation | Procedure |
|---|---|
| Edit | Select Edit, make the approved change, then click Compile and Save. |
| Compile one script | Select Compile in the script row to validate the saved content. |
| Batch compile | Select multiple scripts and use the batch compile button. This is useful after a runtime upgrade. |
| Delete | Confirm that no variable, forwarding target, or rule still references the script, then delete it. |
| Refresh | Reload local and loaded script information after compilation or runtime changes. |
Operational Notes
| Scenario | Recommendation |
|---|---|
| Production change | Back up the project and validate the change with test data before applying it to active acquisition or control points. |
| Compilation failure | Review the first error. Later messages are often consequences of the first failure. |
| Script not listed as loaded | Confirm successful compilation, refresh the Loaded Scripts tab, and verify the selected script type. |
| Referenced script deletion | Replace or remove all references before deletion to prevent affected variables or forwarding targets from failing. |
| AOT deployment | Dynamic compilation availability depends on the deployed package. Complete script validation before deployment. |