Shared Script from Gateway Event in 8.0

How should I call a shared script from a Gateway Timer Event in 8.0? I’ve created a project named “Shared”, added a project library named “paintLine” to it, and set it as the “Gateway Scripting Project” in the gateway configuration.

In another project I have a Gateway Timer Event and I’ve tried using:

These fail with:
“No module named shared”
“NameError: name ‘Shared’ is not defined”
“NameError: name ‘paintLine’ is not defined”

What is the right way to do this?

That setting is for scripts executing on the gateway that aren’t tied to a project - like in tags.

Gateway Event Scripts belong to a project and so your script package should be defined there (or in any project that the current project inherits from).

Ok, that is helpful to know.

So, I copied the methods into the same project that has the gateway event and put them in a library named “util”.

When trying from the gateway timer event:

fail with:
“NameError: global name ‘util’ is not defined”
“NameError: global name ‘project’ is not defined”

Is there some syntax I’m missing?

If you’re able to, try on 8.0.1 - there were some bugs about package management that are fixed in the RC.

Thank you, 8.0.1rc1 fixed the issue.

Has this been changed/improved in 8.1.13? I’d like to have my gateway events in a separate project and available/callable for other projects?

There’s no intention to change this.

Gateway Event Scripts aren’t how you encapsulate code you want to share between projects - use packages and scripts defined in the Project Library of a project that others will inherit.

Thank you very much for the info!