[rules-users] NPE on DecisionTable rule

Hehl, Thomas Thomas.Hehl at acs-inc.com
Tue Aug 28 15:05:57 EDT 2007


Hey, gang!

 

I have a decision table that generated the following rule:

 

{other rules removed}

#From row number: 19

rule "postponePart_19"

      

      when

            PoolInfo(courtLocation == "101")

            PoolInfo(statusCode >= 0, statusCode <= 2)

            PoolInfo(numberFta < 1)

            PoolInfo(numberOfDeferralsPosted < 2)

            PoolInfo(daysBeforeSummons>= 2, daysBeforeSummons<= 999)

      then

            answer.setAnswer(true);

end

 

 

I call these rules with the following code (I build the ruleBase at the
beginning in the factory method to be used by everything:

 

            StatelessSession session =
participantRuleBase.newStatelessSession();

            

            //now create some test data

            PoolInfo pool = part.getActivePool();

            BooleanAnswer answer = new BooleanAnswer();

            

            Object[] rules = new Object[]{pool, answer};

            session.execute(rules);

            

            return answer.isTrue();

 

BooleanAnswer is simply a convenience object I created to store the answer
from the rules. (If anyone has a better way to do this, please let me know.)

 

I got the following stack trace:

 

 

java.lang.NullPointerException

      at
com.acs.gs.juror.bo.Rule_postponePart_19_0.consequence(Rule_postponePart_19_
0.java:6)

      at
com.acs.gs.juror.bo.Rule_postponePart_19_0ConsequenceInvoker.evaluate(Rule_p
ostponePart_19_0ConsequenceInvoker.java:20)

      at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:545)

      at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:509)

      at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.j
ava:430)

      at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.j
ava:402)

      at
org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java
:128)

 

 

I'm a newbie and have no idea what to do next. Please help.

 

Thanks.

Thom Hehl
Sr. eJuror Architect

* Office (859) 277-8800 x 144

* Thomas.Hehl at acs-inc.com <mailto:Thomas.Hehl at acs-inc.com>  
ACS, Inc.

Government Solutions

1733 Harrodsburg Road
Lexington, KY 40504-3617

This e-mail message, including any attachments, is for the sole use of the
intended recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or distribution is
prohibited. If you are not the intended recipient, please contact the sender
by reply e-mail and destroy all copies of the original message and notify
sender via e-mail at Thomas.Hehl at acs-inc.com
<mailto:Thomas.Hehl at acs-inc.com>  or by telephone at 859-277-8800 ext. 144.
Thank you.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070828/363e427d/attachment.html 


More information about the rules-users mailing list