Hello, I'am executing a SQl query when alarm is actived but it is not working.
This the syntax that I'am using. system.db.runNamedQuery("SELECT username FROM wind_users WHERE status = 2","DB")
I noticed this when I put a loger after this line of code.
In fact, the lines of code that follow do not execute.
I test on console : system.db.runNamedQuery("SELECT username FROM wind_users WHERE status = 2") it is workin.
Look at the documentation for these functions for the syntax requirements for the scope you need. Gateway scope (pipeline execution) is not the same thing as Designer scope.
Logger Time Message
NotificationBlock 05Dec2023 21:22:45 Unable to parse calculated roster.
org.python.core.PyException: AttributeError: 'com.inductiveautomation.ignition.common.script.Imm' object has no attribute 'runPredQuery'
at org.python.core.Py.AttributeError(Py.java:178)
at org.python.core.PyObject.noAttributeError(PyObject.java:965)
at org.python.core.PyObject.__getattr__(PyObject.java:959)
at org.python.pycode._pyx177.calculateRoster$1(:19)
at org.python.pycode._pyx177.call_function()
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:306)
at org.python.core.PyFunction.function___call__(PyFunction.java:474)
at org.python.core.PyFunction.__call__(PyFunction.java:469)
at org.python.core.PyFunction.__call__(PyFunction.java:459)
at org.python.core.PyFunction.__call__(PyFunction.java:454)
at com.inductiveautomation.ignition.alarming.pipelines.blocks.NotificationBlock.getEvaluatedRosterFromScript(NotificationBlock.java:233)
at com.inductiveautomation.ignition.alarming.pipelines.blocks.NotificationBlock.sendNotification(NotificationBlock.java:131)
at com.inductiveautomation.ignition.alarming.pipelines.blocks.NotificationBlock$EvaluationContext.onEvaluate(NotificationBlock.java:374)
at com.inductiveautomation.ignition.alarming.pipelines.blocks.AbstractEvaluationContext.evaluate(AbstractEvaluationContext.java:78)
at com.inductiveautomation.ignition.alarming.pipelines.SingleThreadAlarmPipeline$QueueEvaluator.run(SingleThreadAlarmPipeline.java:187)
at java.base/java.lang.Thread.run(Unknown Source)