Drools error? persistent memory rules

8 views
Skip to first unread message

Robnas

unread,
Nov 11, 2019, 8:02:30 AM11/11/19
to OpenRemote
Hello,

i used michal rutka's script to remember the sensor values: https://www.simpleremote.nl/tag/rules/

it worked perfectly untill i installed the new controller on the raspi3:

the error:

ERROR 2019-11-11 13:52:45,833 : Rule definition 'a_startup_rules.drl' could not be deployed. See errors below.
ERROR 2019-11-11 13:52:45,834 : [ERR 102] Line 49:2 mismatched input 'Event' in rule "Init values" in pattern
ERROR 2019-11-11 13:52:45,834 : [ERR 102] Line 50:2 mismatched input 'Event' in rule "Init values"
ERROR 2019-11-11 13:52:45,834 : Parser returned a null Package


which refers to these lines:
  Event($s:source matches "^GV.*", value=="")
  Event($s:source matches "^GV.*", value=="status")

i already tried to modify the lines to:
Event($s:source matches (“^GV.*”), eval(value.equals(“”)))
Event($s:source matches (“^GV.*”), eval(value.equals(“status”))) 


but no luck, does anyone know a solution?

Robnas

unread,
Nov 13, 2019, 3:16:12 AM11/13/19
to OpenRemote
i have already found a solution in the drools ducomentation, this works:

rule "Init values"
  salience 150
when
(Event($s:source matches "^GV.*", value=="") OR Event($s:source matches "^GV.*", value=="status"))
then
  execute.command($s, _ReadFromFile($s, "-"));
Reply all
Reply to author
Forward
0 new messages