[
http://jira.jboss.com/jira/browse/JBRULES-1440?page=all ]
greywind updated JBRULES-1440:
------------------------------
Attachment: current.drl
This is what is currently possible.
The 'nested' Facts have type Object. due to that I cannot access the Properties
directly but have to use the from clause.
If I do try to access it directly I do get an ArrayIndexOutOfBoundsException in mvel and
an (org.drools.RuntimeDroolsException: This is a bug. Please report to development team:
org.drools.facttemplates.FactTemplateFieldExtractor.getValue(java.lang.Object)) in java
org.mvel.PropertyAccessException: unable to resolve property: out.println("Found:
" + name + ", " + id)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:285)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:109)
at
org.mvel.ast.LiteralDeepPropertyNode.getReducedValueAccelerated(LiteralDeepPropertyNode.java:28)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
at org.mvel.MVEL.executeExpression(MVEL.java:235)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:47)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:471)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
at org.drools.entity.EntityTest.main(EntityTest.java:102)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at org.drools.facttemplates.FactImpl.getFieldValue(FactImpl.java:83)
at
org.drools.facttemplates.FactTemplateFieldExtractor.getValue(FactTemplateFieldExtractor.java:30)
at org.drools.rule.Declaration.getValue(Declaration.java:198)
at
org.drools.base.mvel.DroolsMVELPreviousDeclarationVariable.getValue(DroolsMVELPreviousDeclarationVariable.java:32)
at org.mvel.ast.VarPropertyNode.getReducedValueAccelerated(VarPropertyNode.java:18)
at org.mvel.ast.PropertyASTNode.initializePropertyNode(PropertyASTNode.java:112)
at org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:26)
at org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
at org.mvel.ExecutableAccessor.getValue(ExecutableAccessor.java:45)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:521)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:260)
... 11 more
Exception in thread "main" org.drools.spi.ConsequenceException:
org.mvel.PropertyAccessException: unable to resolve property: out.println("Found:
" + name + ", " + id)
at
org.drools.base.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:14)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:554)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:471)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
at org.drools.entity.EntityTest.main(EntityTest.java:102)
Caused by: org.mvel.PropertyAccessException: unable to resolve property:
out.println("Found: " + name + ", " + id)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:285)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:109)
at
org.mvel.ast.LiteralDeepPropertyNode.getReducedValueAccelerated(LiteralDeepPropertyNode.java:28)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
at org.mvel.MVEL.executeExpression(MVEL.java:235)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:47)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)
... 4 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at org.drools.facttemplates.FactImpl.getFieldValue(FactImpl.java:83)
at
org.drools.facttemplates.FactTemplateFieldExtractor.getValue(FactTemplateFieldExtractor.java:30)
at org.drools.rule.Declaration.getValue(Declaration.java:198)
at
org.drools.base.mvel.DroolsMVELPreviousDeclarationVariable.getValue(DroolsMVELPreviousDeclarationVariable.java:32)
at org.mvel.ast.VarPropertyNode.getReducedValueAccelerated(VarPropertyNode.java:18)
at org.mvel.ast.PropertyASTNode.initializePropertyNode(PropertyASTNode.java:112)
at org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:26)
at org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)
at org.mvel.ExecutableAccessor.getValue(ExecutableAccessor.java:45)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:521)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:260)
... 11 more
Support for Nested Templates
----------------------------
Key: JBRULES-1440
URL:
http://jira.jboss.com/jira/browse/JBRULES-1440
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: All
Affects Versions: 4.0.4
Reporter: greywind
Attachments: current.drl
I have to need to use fact templates but I still want to be able to use nested
properties. Currently I cannot do that fully.
What I can do is what is in attachment 'current'. What I would like to do is in
attachment 'wanted'
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira