Skip to content

Script Engine

inSCADA JDK21 ships two distinct scripting environments: server-side (ins.*) and client-side (Inscada.*). They run in different places, target different use cases, and expose isolated API surfaces.

Server-side (ins.*)Client-side (Inscada.*)
Where it runsinSCADA server (JVM)Browser (browser JS)
EngineGraalJS (Nashorn-compat)The browser’s own engine
Bindingins (global)new InscadaApi(projectName)
PurposeAutomation, calculation, alarms, scheduled workUser interaction, UI control
Typical usageScheduled scripts, variable / alarm / log expressions, MQTT parsingAnimation click, custom HTML widgets, dashboard widgets

Server-side (ins.*) detailsClient-side (Inscada.*) details

Scripts fire in many places across the platform. The table below shows the environment each one runs in.

ContextEnvironmentTrigger
Scheduled Scriptserver (ins.*)Periodic / Daily / Once / manual
Variable Expressionserver (ins.*)Automatically on poll cycle
Alarm Expressionserver (ins.*)Automatically on value change
Log Expressionserver (ins.*)Automatically on poll cycle
MQTT Subscribe/Publishserver (ins.*)On every MQTT message
Animation Expressionserver (ins.*)On UI update (remote)
Animation Click Scriptclient (Inscada.*)User click
Custom HTML Widgetclient (Inscada.*, sandboxed iframe)Inside the widget
Dashboard Widgetclient (Inscada.*)Dashboard render / interaction

Scripts run in isolation in both environments, but the constraints differ:

  • Server sideHostAccess.EXPLICIT: only Java methods annotated @HostAccess.Export are accessible. eval and with are disabled. No threads, native access, process creation, or direct file I/O. Default limits: 100k statements, 60s timeout.
  • Client side — custom HTML widgets run inside a sandboxed iframe; they reach the host page API through InscadaBridge using origin-validated postMessage.