Please provide the type declaration for ActorType.Person, field gender and typicial examples how gender fields are used in other rules. Ideally, if you could reduce your rule set to this simple rule and one other rule, still causeing the same problem.

Also, do you use "dialect 'mvel'"?

-W


2011/6/28 Steven Waldren <swaldren@openhealthdata.com>
I am working to migrate my project from 5.0 to 5.2.0 Final.  I am getting an error that I cannot figure out how to fix.

I get the error stack trace below my email signature.  The only thing the consequence does is insert an object.  This rule worked well in 5.0, and some of the early 5.2.0-snapshot builds.  When I comment out the rule, I get the same error for a similar rule.

The rule:

rule "ccr - Person"
when
ActorType.Person($g:gender != null)
then
insert($g);
end

The documentation does not say this is an incorrect syntax. Any help would be appreciated.

Best,
Steven
--
Steven E. Waldren, MD MS
Co-founder, Open Health Data


validateTest(org.openhealthdata.validator.ValidatorManagerTest)  Time elapsed: 11.699 sec  <<< ERROR!
org.drools.runtime.rule.ConsequenceException: rule: ccr - Person

at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:916)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:845)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1056)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:733)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at org.openhealthdata.validator.ValidationManager.validate(ValidationManager.java:158)
at org.openhealthdata.validator.ValidationManager.validate(ValidationManager.java:108)
at org.openhealthdata.validator.ValidatorManagerTest.validateTest(ValidatorManagerTest.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Caused by: org.drools.RuntimeDroolsException: Exception executing predicate 
at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:298)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:130)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:193)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:191)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:119)
at org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:113)
at org.astm.ccr.rules.core.Rule_ccr___Person_0.defaultConsequence(Rule_ccr___Person_0.java:7)
at org.astm.ccr.rules.core.Rule_ccr___Person_0DefaultConsequenceInvoker.evaluate(Rule_ccr___Person_0DefaultConsequenceInvoker.java:27)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:906)
... 37 more
Caused by: java.lang.NullPointerException
at org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:104)
at org.drools.rule.PredicateConstraint.isAllowed(PredicateConstraint.java:291)
... 58 more


_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users