[rules-users] could not access property ('=')
Arsalan S. Zaidi
arsalan.zaidi at capgemini.com
Mon Aug 13 01:48:57 EDT 2007
Hi.
I've currently evaluating Drools 4.0 for a project of ours and I'm
running into some problems.
I have a rule which looks like this:
rule "W250.42 Editable"
when
DTO(w250_4_1.value in
("0","1","6","7","A","C","D","G","L","M","P","Q","S","V","Z") )
then
System.out.println ("0");
Action action = createAction("W250.42", false, true);
retList.add(action);
end
both DTO and w250_4_1 are extremely simple beans. w250_4_1 just has 1
property 'value' which is a String and DTO has one property w250_4_1
which is the bean w250_4_1.
Now when I put "0" into w250_4_1 then everything works fine. The rule is
true and the 'then' portion is executed. However, if I set w250_4_1 to
"6" (which is also present in the in (...)) then I get the following
error.
org.drools.RuntimeDroolsException: Exception executing predicate
org.drools.base.mvel.MVELPredicateExpression at 118fa47
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:1
97)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:122)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Compo
siteObjectSinkAdapter.java:317)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:168)
at org.drools.reteoo.Rete.assertObject(Rete.java:168)
at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:
70)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:848)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:822)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.jav
a:623)
at com.sample.DroolsTest.main(DroolsTest.java:34)
Caused by: org.mvel.PropertyAccessException: failed to access property:
<<==>> in: class com.sample.DTOShadowProxy
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChai
n(ReflectiveAccessorOptimizer.java:137)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccess
or(ReflectiveAccessorOptimizer.java:96)
at org.mvel.ASTNode.getReducedValueAccelerated(ASTNode.java:194)
at org.mvel.ast.Or.getReducedValueAccelerated(Or.java:18)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:87)
at
org.mvel.CompiledExpression.getValue(CompiledExpression.java:98)
at org.mvel.MVEL.executeExpression(MVEL.java:202)
at
org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpre
ssion.java:36)
at
org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:1
91)
... 10 more
Caused by: org.mvel.PropertyAccessException: could not access property
('=')
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.getBeanPropert
y(ReflectiveAccessorOptimizer.java:252)
at
org.mvel.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChai
n(ReflectiveAccessorOptimizer.java:106)
... 18 more
If I keep w250_4_1 as "0", but move "0" in the rule to any other place
place in the in() list (e.g. in ("1","0",...), then I get a similar
error.
I get similar errors when trying to use 'not in' in the same
circumstance, except that then the property is ('!')
What seems to be the issue?
Thanks in advance!
Regards,
--Arsalan
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070813/67028ac9/attachment.html
More information about the rules-users
mailing list