Error Running Project Script: "project not defined"

When scripting across many tags, each gets its own copy of the code. To minimize per-tag code for maintainability, you must move it a shared script. But editing or adding a shared script restarts all gateway scripts across all projects, and causes every client to at least show an update (if not auto-updating). This is astonishingly disruptive. Shared scripts should be locked down to just the most common, best tested code, and placed under some kind of change management. Gateway tag change scripts, as opposed to tag events, can subscribe to many tags, can be enabled and disabled for all quite conveniently, and can be individually enabled/disabled simply by editing the subscription list. And they can call project script instead of having to call shared scripts. Disabling a project disables all of its event scripts. No way to do such a thing with tag events, short of including some code in every one of them to check a common flag somewhere. With gateway events, you can even have multiple projects subscribe to common tags, enabling and disabling in various ways, all without disrupting each other.

Putting project-specific code in shared scripts just to use tag events in a somewhat maintainable way is the height of foolishness, especially when a better alternative is available. If you have a trivial single project in your gateway, have at it.

Tag events are evil.

</rant>

3 Likes