Your right I ment count() :D<br>I have not tryed 4.0.7<br>The thing is last update I made with from 4.0.3 to 4.0.6 made my Drools-sceptic co-workers even more sceptic (see in previous mails). So we'll stick to 4.0.3, but if I have time too, I am going to test my Rules on it. When is the release planned?<br>
Chris<br><br><div class="gmail_quote">2008/4/25 Edson Tirelli <<a href="mailto:tirelli@post.com">tirelli@post.com</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> I don't know what sum( $person ) means, :) but nested accessors definitively should work:<div class="Ih2E3d"><br><br>Number () from accumulate (<br><div style="margin-left: 40px;">$person : Person(<br><div style="margin-left: 40px;">
age > 18,<br>
</div><div style="margin-left: 40px;">dog.weight > 50<br></div>),<br>sum($person)<br></div>)<br><br></div> In Cristine's case, a NPE is being raised:<div class="Ih2E3d"><br><br>
Caused by: java.lang.NullPointerException<br><br></div> Did you guys tried 4.0.7, that is about to be released? Does the error still happens there?<br><br> []s<br> Edson<br><br><br><br><div class="gmail_quote">2008/4/25 Chris Woodrow <<a href="mailto:woodrow.chris@gmail.com" target="_blank">woodrow.chris@gmail.com</a>>:<div>
<div></div><div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>I found out I had this king of errors when I was using nested accessors like :<br><br>
Number () from accumulate (<br><div style="margin-left: 40px;">$person : Person(<br><div style="margin-left: 40px;">age > 18,<br>
</div><div style="margin-left: 40px;">dog.weight > 50<br></div>),<br>sum($person)<br></div>)<br><br>I found I could get rid of these this way :<br><br>Number () from accumulate (<br>
<div style="margin-left: 40px;">$person : Person(<br>
<div style="margin-left: 40px;">age > 18</div>)&& eval($person.getDog().getWeight()>50),<br>
sum($person)<br>
</div>
)<br><br>I guess it is not optimized at all, but at least it does not raise strange exception.<br>Chris<br><br><br><br><div class="gmail_quote">2008/4/25 Christine <<a href="mailto:christine@christine.nl" target="_blank">christine@christine.nl</a>>:<div>
<div></div><div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">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>
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)<br>
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)<br>
at org.drools.reteoo.Rete.assertObject(Rete.java:175)<br>
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)<br>
at<br>
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)<br>
at<br>
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:909)<br>
at<br>
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:881)<br>
at<br>
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:682)<br>
at<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>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at<br>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:585)<br>
at org.junit.internal.runners.TestMethod.invoke(TestMethod.java:59)<br>
at<br>
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:98)<br>
at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:79)<br>
at<br>
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:87)<br>
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:77)<br>
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:42)<br>
at<br>
org.junit.internal.runners.JUnit4ClassRunner.invokeTestMethod(JUnit4ClassRunner.java:88)<br>
at<br>
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)<br>
at<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 org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)<br>
at<br>
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)<br>
at<br>
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)<br>
at<br>
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)<br>
at<br>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)<br>
at<br>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)<br>
at<br>
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)<br>
at<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: null]<br>
at<br>
org.mvel.optimizers.impl.refl.GetterAccessor.getValue(GetterAccessor.java:52)<br>
at<br>
org.mvel.optimizers.impl.refl.VariableAccessor.getValue(VariableAccessor.java:39)<br>
at<br>
org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)<br>
at<br>
org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)<br>
at<br>
org.mvel.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:21)<br>
at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)<br>
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)<br>
at org.mvel.MVEL.executeExpression(MVEL.java:235)<br>
at<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>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at<br>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:585)<br>
at<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" target="_blank">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>
</blockquote></div></div></div><br>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div></div></div><font color="#888888"><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" target="_blank">www.jboss.com</a>
</font><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></blockquote></div><br>