It works when I specify the full java path of the class, as it appears in the repository (less version number):
oScriptManager.addScriptModule(“xas.xasIgnition.xasMaterial.MaterialAPI”, MaterialAPI.class);
So it seems that if the script module is added to the system namespace, any unique name can be specified, and that name will be substituted for the class name.
system.xasdMaterialAPI works, even though the class name in the gateway module is MaterialAPI.
But if a namespace other than system is specified, the full path to the class in the gateway module must be specified.
These inferred rules may not be exactly correct, but they are consistent with what I am seeing.
The weird part is that when I specified a shorter path under xas, the autocomplete system in the designer recognized the class name, and the method in the class. But at execution the script module was not recognized.
In the designer hook class:
oScriptManager.addScriptModule(“xas.MaterialAPI”, MaterialAPI.class);
In the Script Console:
xas.Material… <<-- autocomplete recognizes the script module, up to and including the method in the class. But the script will not run; script module MaterialAPI not found.
It would be nice if the designer would reject (with a message) the add of a module to a non-existent namespace, rather than silently accepting it.