Hide Forgot
Date of First Response: 2010-04-16 20:09:53 securitylevel_name: Public rule 'MaxPriceComparisonRule1' ... dialect "mvel" The rule when $aRBPVO: AutomatedRiskBasedPricingVO($maxPrice: maxPrice) $rBPVO: RiskBasedPricingVO(ysp < $maxPrice) then ... end results in an exception: Exception in thread "main" java.lang.NullPointerException at java.math.BigDecimal.compareTo(BigDecimal.java:2533) at org.drools.base.evaluators.ComparableEvaluatorsDefinition$BigDecimalLessEvaluator.evaluateCachedLeft(ComparableEvaluatorsDefinition.java:241) at org.drools.rule.VariableRestriction.isAllowedCachedLeft(VariableRestriction.java:109) at org.drools.rule.VariableConstraint.isAllowedCachedLeft(VariableConstraint.java:106) at org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaConstraints.java:138) at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:114) at org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:145) at org.drools.reteoo.CompositeLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(CompositeLeftTupleSinkAdapter.java:57) at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:142) at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:360) at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:344) at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185) at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:146) at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1053) at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1008) at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:795) at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:216) at com.ap.test.TestRiskPricing.main(TestRiskPricing.java:103) when using the drools runtime with jars from SOA-P 5.0 (should be the same jars as BRMS 5.1. The rule executes without exceptions using the drools runtime created with jars from JB Tools 3.1. I cannot find a JIRA issue in Drools to cross-reference.
I should have specified that maxPrice is a BigDecimal.
Edson, I think the issue is fixed in 5.1; it seems to work with the jars in the JBoss Tools 3.1. I just could not find a JIRA issue that shows it being fixed? As far as a timeframe, it is a PoC, so for now the rule is not being included in the package. Jeff
Jeff, It was fixed in this issue: https://jira.jboss.org/jira/browse/JBRULES-2102 The changeset is here: http://fisheye.jboss.org/browse/JBossRules/trunk/drools-core/src/main/java/org/drools/base/evaluators/ComparableEvaluatorsDefinition.java?r1=26570&r2=26814 Edson
Release Notes Text: Added: test
Release Notes Text: Removed: test
Release Notes Docs Status: Added: Not Yet Documented Writer: Added: Darrin
Verified fixed in BRMS 5.1.0 ER4.
Temporarily reopening to update release notes information.
Labels: Removed: rn-dmison rn-open Added: rn-dlesage rn-done-resolved
Release Notes Docs Status: Removed: Not Yet Documented Added: Documented as Resolved Issue Writer: Removed: Darrin Added: dlesage Release Notes Text: Added: https://jira.jboss.org/browse/JBRULES-2102 If the right-hand side of an integer to integer comparison was a null pointer, an exception would occur. This was because one of the functions lacked a check for null values on an object. This has now been corrected, so these exceptiosn will no longer occur.