beginNamedQueryTransaction requires undocumented 'project' argument in gateway scope

I think this is the source of some confusion. In the gateway, you know the project when the caller is a gateway event script. You don't know the project when called from a tag event. The corresponding scripting functions in system.db.* that have a datasource argument should have been the model for the named query functions. These functions take an optional datasource in client and gateway project scopes, but the argument is mandatory in gateway non-project scope. Arguably, with v8's new global scripting project, it could be optional there, too.

The project argument for named queries should have been optional for gateway project scopes, and mandatory for gateway non-project scope. (Again, arguably optional in v8 by using the global scripting project.) Whether it should be allowed for client scopes (I think it should) is not relevant for the gateway cases.

The function signature in the gateway (with the project argument first) complicates the situation, but I think it should be changed. It is the one part of Ignition that does not intuitively fall back to the caller's project as needed.

2 Likes