I finally took the time to continue with this one. Moved to OR 2.6, integrated new commands and now back to the original problem. I took virtualy the same the rule code as before. But at deploying, this gives me the following message in the dev log at deploying the controller:
2017-05-26 21:18:18,355 ERROR [Controller Definition File Watcher for Default Deployer]: Unable to build KieBaseModel:OpenRemoteKBase
Rule Compilation error : [Rule name=‘split binary to virtual sensors’]
org/openremote/controller/protocol/Rule_split_binary_to_virtual_sensors286797998.java (15:915) : Syntax error on token “;”, , expected
org/openremote/controller/protocol/Rule_split_binary_to_virtual_sensors286797998.java (16:962) : Syntax error on token “;”, , expected
org/openremote/controller/protocol/Rule_split_binary_to_virtual_sensors286797998.java (17:1010) : Syntax error on token “;”, , expected
2017-05-26 21:18:18,358 ERROR [Controller Definition File Watcher for Default Deployer]: Rule definition ‘modeler_rules.drl’ could not be deployed. See errors below.
2017-05-26 21:18:18,358 ERROR [Controller Definition File Watcher for Default Deployer]: Rule Compilation error Syntax error on token “;”, , expected
Syntax error on token “;”, , expected
Syntax error on token “;”, , expected
2017-05-26 21:18:23,937 ERROR [Controller Definition File Watcher for Default Deployer]: Unable to build KieBaseModel:OpenRemoteKBase
Rule Compilation error : [Rule name=‘split binary to virtual sensors’]
org/openremote/controller/protocol/Rule_split_binary_to_virtual_sensors286797998.java (15:915) : Syntax error on token “;”, , expected
org/openremote/controller/protocol/Rule_split_binary_to_virtual_sensors286797998.java (16:962) : Syntax error on token “;”, , expected
org/openremote/controller/protocol/Rule_split_binary_to_virtual_sensors286797998.java (17:1010) : Syntax error on token “;”, , expected
2017-05-26 21:18:23,938 ERROR [Controller Definition File Watcher for Default Deployer]: Rule definition ‘modeler_rules.drl’ could not be deployed. See errors below.
2017-05-26 21:18:23,938 ERROR [Controller Definition File Watcher for Default Deployer]: Rule Compilation error Syntax error on token “;”, , expected
Syntax error on token “;”, , expected
Syntax error on token “;”, , expected
Here is the exact rule code:
rule “split binary to virtual sensors”
when
$evt:Event( source == “alarmbinairsensor”, $val : value)
//my_binary_sensor is splitted by space
//we use when here in fact to capture the change and push the value itself to a variable
then
String valStr = $val.toString();
//probably not needed in my case, but just to be sure
//this if should always be true
if (valStr != null && valStr.length() == 6) {
String aStr = valStr.substring(0,1);
String bStr = valStr.substring(2,3);
String cStr = valStr.substring(4,5);
execute.command(“virtual_sts_aanw”; aStr);
execute.command(“virtual_sts_afw”; bStr);
execute.command(“virtual_sts_vrdr”; cStr);
}
end
``
Anyone got a clue? I compared to the sample rules on the github page, but found no syntax differences.