AXScripting / AX Groovy (legacy scripting in Niagara AX)

Niagara AX is still running buildings – and its scripting is still holding them together. AXScripting and the Groovy-based logic in legacy AX stations were written years ago by people who have often moved on. Software Pile maintains, repairs, and eventually migrates that code so the building keeps running while you plan its future.

Legacy AX Work We Handle

  • Reading, documenting, and repairing existing AXScripting and Groovy logic nobody on staff understands anymore
  • Keeping AX stations serviceable: fixing broken sequences, adding points, and adjusting logic without a full rebuild
  • Assessing what the scripts actually do before an AX-to-N4 migration, so nothing is lost in translation
  • Reimplementing legacy script logic cleanly in N4 when the time comes

The Migration Question

AX is end-of-life, and everyone knows it – but “rip it all out” is rarely the right first move. We keep AX stations healthy today and build a migration plan that moves logic to N4 on your schedule, with the scripts understood and documented before they are touched.

Tell us about your AX stations – version, scope, and whether you are maintaining or migrating. We handle both.

What Was AxScripting?

AxScripting brought scripting — commonly Groovy — into Niagara AX stations, letting engineers write logic in script form rather than assembling it entirely on the wiresheet. It was useful for calculations, data manipulation and integration behaviour that would have been awkward as blocks.

It belongs to the AX generation. If you are running scripts in AX today, they are one of the specific things that needs an explicit decision during an AX to N4 migration — they do not simply carry across.

What Happens to AX Scripts in an N4 Migration?

Each script needs a decision, and the decision is rarely automatic:

  • Reimplement as a Niagara module. Logic that matters and will persist is usually better expressed as a proper component built on the Baja API — version-controlled, signed, testable and visible to engineers.
  • Rebuild on the wiresheet. Some scripts exist only because a block did not exist at the time. In N4 there may now be a native way.
  • Retire it. A meaningful share of legacy scripts serve equipment that is gone or a report nobody reads. Migrating them is pure cost.
  • Replace with tagging and query. Scripts that exist to work around inconsistent naming are often better solved by tagging and BQL.

Why Legacy Scripts Are a Migration Risk

Scripts are the part of a station most likely to be undocumented, written by someone no longer available, and quietly load-bearing. They frequently encode business rules — a billing calculation, a compliance threshold, an override for one difficult tenant — that exist nowhere else.

Inventory them before the migration, not during. For each: what it does, what it touches, who depends on the output, and whether anyone would notice if it stopped. That last question retires more scripts than any technical analysis.

Should You Use Scripting in N4?

Where a genuine scripting requirement exists, evaluate it against the alternative of a compiled module. Scripts are quick to write and easy to change, which is their appeal and their risk: they are also easy to change without review, hard to version, and easy to lose track of.

For anything durable or business-critical, a signed, version-controlled module is the safer home. Reserve scripting for genuinely local, low-consequence behaviour — and write down what it does.

Related services: AX to N4 migration services · custom module development.

The Module Matters More Than the Code

A Groovy script in an AX station is not free-standing code. The station stores the script text as a property value on a component, and that component's type resolves to a module jar installed on the host. Alongside the question of what a script does, then, sits a mechanical one that can be answered first: which module defines the component, and does an N4 build of that module exist. Module packaging also changed between the generations. An AX module shipped as a single jar, while an N4 module is split into runtime, UX and Workbench jars, so an AX jar cannot be dropped into an N4 host's modules directory and expected to resolve. This is the constraint that usually settles the migration question before anyone reads a line of Groovy.

N4 additionally enforces module signing, and later 4.x releases treat an unsigned or wrongly signed module as a load failure rather than a warning. A one-off jar built years ago by an integrator who is no longer reachable cannot be signed without its source, which means the component type is simply unavailable on the new host. Where no N4 build of the defining module exists, the script does not carry over as it stands, and the logic has to find another home in N4: a component on the Baja API, an equivalent assembled on the wiresheet, tagging and a query, or nothing at all where the equipment it served has gone.

Inventorying Scripts Without Opening Every Component

A station backup is enough to do most of the inventory offline. A bog file is a zip archive containing file.xml, so the entire station configuration, including script source held as component property values, is readable as text. Searching that XML for import statements, class names and distinctive strings finds logic faster than clicking through the nav tree, and it finds it in folders nobody remembered were there.

On a running station, a BQL query from the station root returns every instance of a component type together with its slot path, which gives the complete list rather than the list somebody remembers. BQL predicates work against property values, so the same query narrows to components whose source text contains a particular device name, point path or unit string. That is how you get from a list of scripts to a list of scripts that touch one piece of equipment.

Presence is not use. A script component can exist, hold real code, and never execute, because its inputs were unlinked, its parent folder is disabled, or its execution trigger was removed at some point nobody recorded. Check status flags and last execution time before treating a component as live logic. A count of script components overstates the amount of running logic, sometimes by a wide margin, and the difference is worth establishing before any of it is scheduled for reimplementation.

What Constrains the Migration Schedule

The conversion path has a version floor. An AX station has to be at 3.8 before the N4 tooling will convert it, so a station still on 3.5, 3.6 or 3.7 is really two pieces of work: an in-generation AX upgrade with its own module compatibility problems, and then the conversion. Third-party AX modules tend to fail at that first step rather than the second, which is a reason to do it before any date is committed to for the migration itself.

Some AX-era controller hardware cannot run N4 at any version, and for those sites the work is a controller replacement with a commissioning window and licensing attached rather than a software upgrade. The limit is the platform, not a setting: N4 expects a Java 8 class library and more RAM and flash than the JVM on those controllers was built around. No configuration moves that line.

Migration does not have to be a single cutover. An N4 Supervisor can hold Niagara Network connections to AX 3.8 stations that have not moved yet, subject to a compatible build, so controllers convert one at a time instead of all at once. A station carrying load-bearing or difficult logic can be scheduled late on purpose, so the reimplementation is checked against the original while the original is still running.

What a Rebuilt Component Breaks Downstream

Script outputs are rarely consumed only by the wiresheet beside them. History extensions, alarm extensions and Niagara Network subscriptions all reference a slot by ORD, and a history ID is assembled from the station name and the history's own name. Reimplement the logic under a different component name and the trend does not continue: a second history starts alongside the first, and anything built on the old ID stops gaining data at the changeover without reporting an error.

The cheap version of the fix is to keep the slot path and the extension names identical when the logic moves, even when the new component is nothing like the old one internally. Where a name genuinely has to change, moving the histories is separate work with its own decision about whether the old data is renamed, merged, or left in place as an archive. That decision costs more after the cutover than before it.

  • History extensions on a script output: the history ID carries the point name, so a rename produces a new history rather than a continuation of the old one.
  • Alarm extensions: alarm class routing and existing acknowledgment records are tied to the source, so a rebuilt source is a new source as far as the alarm console is concerned.
  • Niagara Network subscriptions: a Supervisor or peer station still pointing at the old ORD resolves to a fault instead of a value, and one faulted proxy point is easy to miss on a busy station.
  • Reporting and exports keyed on history ID: anything outside Niagara that pulls by ID keeps returning the old series, which reads as data that simply stopped rather than as a broken reference.

Frequently Asked Questions

Is AxScripting the same thing as a Niagara Program object?

No. A Program object holds Java source, ships with the standard install, and compiles inside the station, while the Groovy script components AxScripting refers to came from a separate module and hold their source as a property value. They also migrate differently. The Program component has a direct counterpart in N4, so the object itself survives even though its source still has to compile against the N4 API, whereas a Groovy script component depends on a module that may have no N4 build at all. Establish which of the two you have before planning anything, because both appear in an inventory as a component with code in it.

Can AX scripts run in N4 unchanged?

No. Three conditions have to hold for a script to run on the new host: the component type has to exist in N4, its module has to load under N4's signing rules, and the code has to run against the N4 API and its Java version. They fail independently, so code that is perfectly valid Groovy can still stop at the first condition. For logic that is kept, the practical outcome is reimplementation, with the old source treated as the specification of what the logic was meant to do.

What has to exist before anyone can assess our AX scripts?

A backup, credentials, and a module list. Platform and station credentials are needed for anything that has to be checked live rather than in the file, such as whether a component is actually executing. The module list matters as much as the code, because the assessment turns on which modules are installed and at what version, and the same applies to the Workbench used to open the station: without the station's modules installed alongside it, components come up unresolved in the tool as well as on the host. The station's AX version tells you whether an in-generation upgrade sits in front of the migration.

Does the existing license carry over to N4?

No. Niagara licensing is tied to a host ID and to a brand, so an N4 host needs a license issued for it, and that license carries a maintenance expiration date which governs the builds it will run: a version of N4 released after that date will not start. The compatibility statement on the license separately governs which stations and devices the host is allowed to connect to, which is a different question from whether the software installs. This is worth settling early, since it can be the thing that decides whether a controller is upgraded or replaced.

Can we keep the AX stations as they are for now?

Yes, and that is a normal position while a migration is planned. It depends on keeping the means to work on them: a Workbench install at the station's version, the module jars the station uses, and the license files, none of which can be pulled fresh from a vendor download page for an end-of-life release. Take a known-good backup before every edit, because a broken AX station is not reinstalled from scratch as easily as a current one. Plan also on defects being worked around rather than patched, since no further AX releases are coming.

What do we have to decide, rather than the engineer?

Two things usually need an owner rather than an engineer. The first is whether a script can be taken out of service for an observation period, since the fastest way to find out what one does is to stop it and see who calls; that is an operational decision, and it is not available on anything touching billing, safety or compliance. The second is whether the reimplementation should reproduce the original's quirks or correct them, because long-lived scripts often contain a rounding rule or a boundary condition that downstream reports have absorbed, and correcting it changes numbers people have been reading for years. Both are judgments about the building rather than about the code.