]
Geoffrey De Smet updated JBRULES-2871:
--------------------------------------
Fix Version/s: 5.3.0.Final
(was: 5.3.0.CR1)
KnowledgeAgent: unable to determine operator for symbol [after]
---------------------------------------------------------------
Key: JBRULES-2871
URL:
https://issues.jboss.org/browse/JBRULES-2871
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 5.1.1.FINAL
Reporter: Oscar de Groot
Assignee: Esteban Aliverti
Fix For: 5.3.0.Final
When loading a knowledge base via a KnowledgeAgent, only the operators defined in
org.drools.base.evaluators.Operator (== != >= < <= <) are supported. When
loading the same knowledge base via a KnowledgeBuilder, all operators are supported.
Upon loading a knowledge base that contains another operator (e.g. "after",
"before"), the following error is printed:
[2011:01:19 14:01:44:exception]
java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize
KnowledgeDefinitionsPackage
at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:674)
at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:899)
...
Caused by: org.drools.RuntimeDroolsException: unable to determine operator for symbol
[after]
at org.drools.base.evaluators.Operator.determineOperator(Operator.java:87)
at org.drools.base.evaluators.Operator.readResolve(Operator.java:122)
Using Eclipse's debugging feature, I have determined that KnowledgeBuilder loads the
rest of the operators through EvaluatorRegistry, while KnowledgeAgent does nothing to load
any operators into org.drools.base.evaluators.Operator. I have tried modifying
KnowledgeAgent by adding the code below to the constructor of KnowledgeAgentImpl. This
resolves the problem: with this addition, the knowledge base with
"after"-operator works as intended when loaded via a KnowledgeAgent.
// Load all of Drools' default evaluators instead of just the ones defined
// in org.drools.base.evaluators.Operator
new EvaluatorRegistry();
--
This message is automatically generated by JIRA.
For more information on JIRA, see: