This page last changed on May 27, 2014 by p3tter1.

Hello i have some issues with my rules code in OR PRO 1.0.13

Here is my errors

DEPLOYING NEW CONTROLLER RUNTIME...

--------------------------------------------------------------------

May 27, 2014 9:00:48 AM org.restlet.engine.http.connector.HttpClientHelper stop
INFO: Stopping the default HTTP client
ERROR 2014-05-27 09:00:50,161 : Rule definition 'modeler_rules.drl' could not be deployed. See errors below.
ERROR Controller Definition File Watcher for Default Deployer: Rule definition 'modeler_rules.drl' could not be deployed. See errors below.
ERROR 2014-05-27 09:00:50,165 : ERR 103 Line 2:0 rule 'rule_key' failed predicate:

Unknown macro: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}

? in rule
ERROR Controller Definition File Watcher for Default Deployer: ERR 103 Line 2:0 rule 'rule_key' failed predicate:

? in rule
ERROR 2014-05-27 09:00:50,169 : ERR 101 Line 2:8 no viable alternative at input 'org' in rule package
ERROR Controller Definition File Watcher for Default Deployer: ERR 101 Line 2:8 no viable alternative at input 'org' in rule package
ERROR 2014-05-27 09:00:50,173 : ERR 101 Line 3:0 no viable alternative at input 'global' in rule package in rule protocol
ERROR Controller Definition File Watcher for Default Deployer: ERR 101 Line 3:0 no viable alternative at input 'global' in rule package in rule protocol
2,0: ERR 103 Line 2:0 rule 'rule_key' failed predicate:
Unknown macro: {(validateIdentifierKey(DroolsSoftKeywords.RULE))}
? in rule
2,8: ERR 101 Line 2:8 no viable alternative at input 'org' in rule package
3,0: ERR 101 Line 3:0 no viable alternative at input 'global' in rule package in rule protocol
ERROR 2014-05-27 09:00:50,183 : There was an error parsing the rule definition 'modeler_rules.drl' : Could not parse knowledge.
java.lang.IllegalArgumentException: Could not parse knowledge.
at org.drools.builder.impl.KnowledgeBuilderImpl.newKnowledgeBase(KnowledgeBuilderImpl.java:58)
at org.openremote.controller.statuscache.rules.RuleEngine.getValidKnowledgePackages(Unknown Source)
at org.openremote.controller.statuscache.rules.RuleEngine.start(Unknown Source)
at org.openremote.controller.statuscache.EventProcessorChain.start(Unknown Source)
at org.openremote.controller.statuscache.StatusCache.start(Unknown Source)
at org.openremote.controller.deployer.Version20ModelBuilder.buildSensorModel(Unknown Source)
at org.openremote.controller.deployer.Version20ModelBuilder.build(Unknown Source)
at org.openremote.controller.deployer.AbstractModelBuilder.buildModel(Unknown Source)
at org.openremote.controller.service.Deployer.startup(Unknown Source)
at org.openremote.controller.service.Deployer.softRestart(Unknown Source)
at org.openremote.controller.service.Deployer$ControllerDefinitionWatch.run(Unknown Source)
at java.lang.Thread.run(Thread.java:701)
ERROR Controller Definition File Watcher for Default Deployer: There was an error parsing the rule definition 'modeler_rules.drl' : Could not parse knowledge.
java.lang.IllegalArgumentException: Could not parse knowledge.
at org.drools.builder.impl.KnowledgeBuilderImpl.newKnowledgeBase(KnowledgeBuilderImpl.java:58)
at org.openremote.controller.statuscache.rules.RuleEngine.getValidKnowledgePackages(Unknown Source)
at org.openremote.controller.statuscache.rules.RuleEngine.start(Unknown Source)
at org.openremote.controller.statuscache.EventProcessorChain.start(Unknown Source)
at org.openremote.controller.statuscache.StatusCache.start(Unknown Source)
at org.openremote.controller.deployer.Version20ModelBuilder.buildSensorModel(Unknown Source)
at org.openremote.controller.deployer.Version20ModelBuilder.build(Unknown Source)
at org.openremote.controller.deployer.AbstractModelBuilder.buildModel(Unknown Source)
at org.openremote.controller.service.Deployer.startup(Unknown Source)
at org.openremote.controller.service.Deployer.softRestart(Unknown Source)
at org.openremote.controller.service.Deployer$ControllerDefinitionWatch.run(Unknown Source)
at java.lang.Thread.run(Thread.java:701)
INFO 2014-05-27 09:00:50,241 : Initialized event processor : Drools Rule Engine
INFO 2014-05-27 09:00:50,391 : Initialized event processor : RRD4J Data Logger
May 27, 2014 9:00:54 AM org.restlet.engine.http.connector.HttpClientHelper start

And my Rules is

package org.openremote.controller.model.event
package org.openremote.controller.protocol
global org.openremote.controller.statuscache.CommandFacade execute;
global org.openremote.controller.statuscache.SwitchFacade switches;
import org.apache.commons.io.FileUtils;
import java.net.URL;
import java.io.File;

rule "Poll Vera every second"
timer (cron: * * * * * ?)
when
eval(true)
then
pollVera();
end

function void pollVera()

Unknown macro: { FileUtils.copyURLToFile(new URL("http}

rule "Turn Music on via KNX"
when
$evt:Event(source == "strtatgrhgs", value == "on")
then
execute.command("play");
end

What is wrong with my setup? its just copied from a HOW TO page.

Thanks.

You have 2 lines with package definitions:
package org.openremote.controller.model.event
package org.openremote.controller.protocol

Change it to only one:

package org.openremote.controller.protocol;

Posted by aktur at May 28, 2014 13:15
Document generated by Confluence on Jun 05, 2016 09:37