Call Script function from Module

Hello,

is it somehow possible to call a own script function from a Module?

def foo(params)
      print params

Something like

ScriptManager.call(“tools.foo” , params)

br,
Roland

Generally speaking, you’re going to have a much easier time doing this if you just write your logic in Java, but, you could technically run an arbitrary script from the ScriptManager available on the context object your module’s hook will get during setup() in whatever scope(s) it’s registered for. CommonContext defines getScriptManager, which has various runCode and related overloads; eg:
com.inductiveautomation.ignition.common.script.ScriptManager#runCode(java.lang.String, org.python.core.PyObject, java.lang.String)