[rules-users] required some input on String comparision in xml rule file.

Mahantesh mahanteshsg at gmail.com
Mon Jan 29 03:57:53 EST 2007


Hi,

I am using Drools 3 JBoss Rule Engine and xml file as a rule file. when i am
using integer condition in LHS part of rule file it is working fine.
For example:  <eval> beanObject.getNumber >= 60 </eval>

but when using  string condition in LHS part of the rule file, it is able to
filter the data when setting and getting the data from the dummy bean, but
not able to filter the data when the data is coming from the database its
throwing the exceptions like this.

For Example: <eval> beanObject.getName()</eval>

Exception like this.

org.drools.RuntimeDroolsException: java.lang.NullPointerException
       at org.drools.rule.EvalCondition.isAllowed (Unknown Source)
       at org.drools.reteoo.EvalConditionNode.assertTuple(Unknown Source)
       at org.drools.reteoo.TupleSource.propagateAssertTuple(Unknown Source)
       at org.drools.reteoo.JoinNode.assertObject (Unknown Source)
       at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown
Source)
       at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
       at org.drools.reteoo.Rete.assertObject (Unknown Source)
       at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
       at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown
Source)
       at org.drools.common.AbstractWorkingMemory.assertObject (Unknown
Source)
       at org.drools.common.AbstractWorkingMemory.assertObject(Unknown
Source)
       at org.drools.jsr94.rules.StatelessRuleSessionImpl.executeRules(Unknown
Source)
       at org.drools.jsr94.rules.StatelessRuleSessionImpl.executeRules(Unknown
Source)
       at rules1.TestRuleForXML.applyRuleTestingProcessVO(
TestRuleForXML.java:176)
       at rules1.TestRuleForXML.applyForProcessVO(TestRuleForXML.java:55)
size of the ouput list in  java file: 0

       at rules1.TestRuleForXML.main(TestRuleForXML.java:47)
Caused by: java.lang.NullPointerException
       at rules1.Rule_my_rule_0.eval0(Rule_my_rule_0.java:12)
       at rules1.Rule_my_rule_0Eval0Invoker.evaluate(Rule_my_rule_0Eval0Invoker.java:19)

If you do a help regarding how to work with String condition in LHS part, it
will be great..

Thanks in Advance,
Mahantesh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070129/8e3219d0/attachment.html 


More information about the rules-users mailing list