Hello all!
First of all, my apologies for the cryptic title, it’s hard to explain.
I have a scripting funcion that uses two parameters, for example:
system.mymodule.myfunction(Date date1, Date date2)
This funcion uses a project resource to perform some task. When I execute it on the script console it works great because when I create the script module I pass the project from where I’m executing as a parameter (that way the module can gather the resource using the projectName), like this:
//IN DESIGNER HOOK
public void initializeScriptManager(ScriptManager manager) {
super.initializeScriptManager(manager);
manager.addScriptModule(
"system.mymodule",
new DesignerScriptModule(DesignerHook.getDesignerContext().getProjectName()),
new PropertiesFileDocProvider()
);
}
The problem is that when I add the script module in the gateway, I obviously cannot add a project name since we can have multiple projects in a gw.
//IN GATEWAYHOOK
public void initializeScriptManager(ScriptManager manager) {
super.initializeScriptManager(manager);
manager.addScriptModule(
"system.performanceRatio",
new GatewayScriptModule(),
new PropertiesFileDocProvider());
}
Is there any way to have the gateway know which project set the script up? Of course I can always add another parameter to the function and let the user write the project name but that seems less elegant.
Thanks in advance!