<br>&nbsp;&nbsp; Cristine, <br><br>&nbsp;&nbsp; If that is happening, it is probably a bug. It would be really helpful if you could provide a self contained test case, so that we can investigate and fix.<br><br>&nbsp;&nbsp; Thanks,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Edson<br>
<br><div class="gmail_quote">2008/4/25 Christine &lt;<a href="mailto:christine@christine.nl">christine@christine.nl</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks Chris. Just replacing &quot;product.type == ProductType.WA&quot; by the same<br>
as an eval works. But it is strange that in one place the original line<br>
works while three lines down the same line doesn&#39;t.<br>
<font color="#888888"><br>
Christine<br>
</font><div><div></div><div class="Wj3C7c"><br>
&gt; Hi,<br>
&gt; I found out I had this king of errors when I was using nested accessors<br>
&gt; like<br>
&gt; :<br>
&gt;<br>
&gt; Number () from accumulate (<br>
&gt; $person : Person(<br>
&gt; age &gt; 18,<br>
&gt; dog.weight &gt; 50<br>
&gt; ),<br>
&gt; sum($person)<br>
&gt; )<br>
&gt;<br>
&gt; I found I could get rid of these this way :<br>
&gt;<br>
&gt; Number () from accumulate (<br>
&gt; $person : Person(<br>
&gt; age &gt; 18<br>
&gt; )&amp;&amp; eval($person.getDog().getWeight()&gt;50),<br>
&gt; sum($person)<br>
&gt; &nbsp;)<br>
&gt;<br>
&gt; I guess it is not optimized at all, but at least it does not raise strange<br>
&gt; exception.<br>
&gt; Chris<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2008/4/25 Christine &lt;<a href="mailto:christine@christine.nl">christine@christine.nl</a>&gt;:<br>
&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt; does anyone know what this error means?<br>
&gt;&gt; It happens when I put an enum constant in a rule. I use the same enum<br>
&gt;&gt; constant in another part of the same rule with no problem.<br>
&gt;&gt;<br>
&gt;&gt; Christine<br>
&gt;&gt;<br>
&gt;&gt; org.drools.RuntimeDroolsException: Exception executing predicate<br>
&gt;&gt; org.drools.base.mvel.MVELPredicateExpression@125844f<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:132)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at org.drools.reteoo.Rete.assertObject(Rete.java:175)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:909)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:881)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:682)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; nl.ing.towardsdeepdrive.rules.SalesRules.assertCompetitorProduct(SalesRules.java:42)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at rules.SalesRulesTest.TestRules(SalesRulesTest.java:53)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at java.lang.reflect.Method.invoke(Method.java:585)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)<br>
&gt;&gt; Caused by: org.mvel.CompileException: cannot invoke getter: getType<br>
&gt;&gt; [declr.class: nl.ing.towardsdeepdrive.data.model.Product; act.class:<br>
&gt;&gt; null]<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.mvel.optimizers.impl.refl.GetterAccessor.getValue(GetterAccessor.java:52)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.mvel.optimizers.impl.refl.VariableAccessor.getValue(VariableAccessor.java:39)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at org.mvel.MVEL.executeExpression(MVEL.java:235)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:36)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt; org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:210)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;... 33 more<br>
&gt;&gt; Caused by: java.lang.NullPointerException<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at java.lang.reflect.Method.invoke(Method.java:585)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;at<br>
&gt;&gt;<br>
&gt;&gt; org.mvel.optimizers.impl.refl.GetterAccessor.getValue(GetterAccessor.java:42)<br>
&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;... 42 more<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-users mailing list<br>
&gt;&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>