I am running version 8.0.15 and on my message handler I am receiving the following message.
def onMessageReceived(self, payload):
"""
This method will be called when a message with the matching type code
arrives at this component.
Arguments:
self: A reference to this component
payload: The data object sent along with the message
"""
self.custom.jobPath = payload
com.inductiveautomation.ignition.common.script.JythonExecException
Traceback (most recent call last):
File "<function:onMessageReceived>", line 2, in onMessageReceived
UnboundLocalError: local variable 'payload' referenced before assignment
at org.python.core.Py.UnboundLocalError(Py.java:295)
at org.python.core.PyFrame.getlocal(PyFrame.java:240)
at org.python.pycode._pyx689.onMessageReceived$1(<function:onMessageReceived>:2)
at org.python.pycode._pyx689.call_function(<function:onMessageReceived>)
at org.python.core.PyTableCode.call(PyTableCode.java:171)
at org.python.core.PyBaseCode.call(PyBaseCode.java:308)
at org.python.core.PyFunction.function___call__(PyFunction.java:471)
at org.python.core.PyFunction.__call__(PyFunction.java:466)
at org.python.core.PyFunction.__call__(PyFunction.java:461)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:822)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:806)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:687)
at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:965)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:752)
at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:101)
at com.inductiveautomation.perspective.gateway.model.MessageHandlerCollection$MessageHandlerImpl$1.lambda$invoke$0(MessageHandlerCollection.java:80)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.python.core.PyException
Traceback (most recent call last):
File "<function:onMessageReceived>", line 2, in onMessageReceived
UnboundLocalError: local variable 'payload' referenced before assignment
... 21 more
Ignition v8.0.15 (b2020072213)
Java: Azul Systems, Inc. 11.0.6