<br> Cristine, <br><br> 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> Thanks,<br> Edson<br>
<br><div class="gmail_quote">2008/4/25 Christine <<a href="mailto:christine@christine.nl">christine@christine.nl</a>>:<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 "product.type == ProductType.WA" 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't.<br>
<font color="#888888"><br>
Christine<br>
</font><div><div></div><div class="Wj3C7c"><br>
> Hi,<br>
> I found out I had this king of errors when I was using nested accessors<br>
> like<br>
> :<br>
><br>
> Number () from accumulate (<br>
> $person : Person(<br>
> age > 18,<br>
> dog.weight > 50<br>
> ),<br>
> sum($person)<br>
> )<br>
><br>
> I found I could get rid of these this way :<br>
><br>
> Number () from accumulate (<br>
> $person : Person(<br>
> age > 18<br>
> )&& eval($person.getDog().getWeight()>50),<br>
> sum($person)<br>
> )<br>
><br>
> I guess it is not optimized at all, but at least it does not raise strange<br>
> exception.<br>
> Chris<br>
><br>
><br>
><br>
> 2008/4/25 Christine <<a href="mailto:christine@christine.nl">christine@christine.nl</a>>:<br>
><br>
>> Hi,<br>
>> does anyone know what this error means?<br>
>> It happens when I put an enum constant in a rule. I use the same enum<br>
>> constant in another part of the same rule with no problem.<br>
>><br>
>> Christine<br>
>><br>
>> org.drools.RuntimeDroolsException: Exception executing predicate<br>
>> org.drools.base.mvel.MVELPredicateExpression@125844f<br>
>> at<br>
>> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:216)<br>
>> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:132)<br>
>> at<br>
>><br>
>> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)<br>
>> at<br>
>> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)<br>
>> at org.drools.reteoo.Rete.assertObject(Rete.java:175)<br>
>> at<br>
>> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)<br>
>> at<br>
>> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)<br>
>> at<br>
>><br>
>> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:909)<br>
>> at<br>
>><br>
>> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:881)<br>
>> at<br>
>><br>
>> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:682)<br>
>> at<br>
>><br>
>> nl.ing.towardsdeepdrive.rules.SalesRules.assertCompetitorProduct(SalesRules.java:42)<br>
>> at rules.SalesRulesTest.TestRules(SalesRulesTest.java:53)<br>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
>> at<br>
>><br>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
>> at<br>
>><br>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
>> at java.lang.reflect.Method.invoke(Method.java:585)<br>
>> at<br>
>> org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)<br>
>> at<br>
>> org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)<br>
>> at<br>
>> org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)<br>
>> at<br>
>><br>
>> org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)<br>
>> at<br>
>> org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)<br>
>> at<br>
>> org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)<br>
>> at<br>
>><br>
>> org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)<br>
>> at<br>
>><br>
>> org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)<br>
>> at<br>
>><br>
>> org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)<br>
>> at<br>
>> org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)<br>
>> at<br>
>> org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)<br>
>> at<br>
>> org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)<br>
>> at<br>
>><br>
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)<br>
>> at<br>
>><br>
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br>
>> at<br>
>><br>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)<br>
>> at<br>
>><br>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)<br>
>> at<br>
>><br>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)<br>
>> at<br>
>><br>
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)<br>
>> Caused by: org.mvel.CompileException: cannot invoke getter: getType<br>
>> [declr.class: nl.ing.towardsdeepdrive.data.model.Product; act.class:<br>
>> null]<br>
>> at<br>
>><br>
>> org.mvel.optimizers.impl.refl.GetterAccessor.getValue(GetterAccessor.java:52)<br>
>> at<br>
>><br>
>> org.mvel.optimizers.impl.refl.VariableAccessor.getValue(VariableAccessor.java:39)<br>
>> at<br>
>><br>
>> org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)<br>
>> at<br>
>><br>
>> org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)<br>
>> at<br>
>><br>
>> org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)<br>
>> at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)<br>
>> at<br>
>> org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)<br>
>> at org.mvel.MVEL.executeExpression(MVEL.java:235)<br>
>> at<br>
>><br>
>> org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:36)<br>
>> at<br>
>> org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:210)<br>
>> ... 33 more<br>
>> Caused by: java.lang.NullPointerException<br>
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
>> at<br>
>><br>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
>> at<br>
>><br>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
>> at java.lang.reflect.Method.invoke(Method.java:585)<br>
>> at<br>
>><br>
>> org.mvel.optimizers.impl.refl.GetterAccessor.getValue(GetterAccessor.java:42)<br>
>> ... 42 more<br>
>><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>
>><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>
><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>