You no longer reference “project” scripts with project.package_name.method_name any longer, unless your “Scripting/Project Library/<package_name>” is actually “Scripting/Project Library/project”
In the following screenshot I would reference THIS project’s scripts with project.Security.<method_name>
And I would access shared scripts (which are located in the parent project) with shared.<package_name>.<method_name>
Notes:
Inherited scripts are always under “shared” regardless of the parent project’s name.
“project” only happens to be what I’ve named the package - you can name it anything else (within reason) and reference it with <high_level_package_name>.<low-level_package_name>.<method_name>(**args)
Well its both, lots of screens exported from 7.9.9 had the error then I went to v8.0 help and it instructed me to use “project.script.sub” so updating the documentation is really the answer. (Yes i understand the documentation is underway)
I’m working on replicating this, but I need some clarifications:
Did you import a 7.9.9 project, OR did you upgrade an already deployed 7.9.9 project, OR did you restore a 7.9.9 Gateway backup?
jhottell - cmallonee is asking these questions because doing an update of an existing system with the installer or restoring a .gwbk from a prior version into 8 is supposed to automatically put scripts in the right location so they don’t have any issues. In theory, if you do an upgrade, you shouldn’t need to change any of your scripts and everything should continue to work as it did before.
OK sorry for the delay.
It is NOT from gateway or project backup. Its from FIle --> Import and Export.
I just tried it again and they all imported into the same space which may be intentional?
There are some other reasons why restoring from a gateway backup doesn’t work on my system so I can’t test how that would work (UDT’s referencing themselves as a parent type) but that is another story.
Hi. We have recently upgraded a server from 7.9 to 8 and are seeing a similar issue with referencing the inherited shared scripts. We have several tag event scripts that are calling out a legacy script with the syntax listed above. In one example of ours looks like “shared.OEE.logdowntime()”, but we’re still seeing the error that the global name ‘shared’ is not defined.
The project “global” has the scripts from the upgrade and is inheritable and set as the parent project to the project using these tags, but I’m not certain tag event scripts are tied to any project settings. Please let me know if there is a different syntax or solution for letting tags reference the new project and legacy scripts. Thank you.
Also, have you restarted the gateway since restoring? There’s an issue (fixed in 8.0.10) with the initial gateway launch after restoring from 7.9 not correctly ‘setting’ the gateway scripting project (although it does update the setting, so subsequent restarts are fine).
Hi yes I saw this setting in the gateway and it was correct. I selected save changes and immediately saw some of our global scripts store data into SQL so it seems a refresh was needed. We also had a refresh issue with setting our default tag provider where it was set correctly and we happened to press the refresh button and saw the issues go away.
I have not restarted the server since installing so I will do so now thank you! I will reply here if we see the issue return otherwise I think it just needs to refresh it’s settings after they’ve been updated thanks for your help!