[rules-dev] Dealing with null pointer exceptions thrown by parsing rules

Zevenbergen, Alex azevenbergen at paddypower.com
Tue Feb 24 04:24:49 EST 2009


Hi all,

 

I have started writing my rules packages and so have had a decent amount
of success. However all my rules are based on value pairs from a hashmap
object that is contained within my fact object. This approach works fine
if the parameter the rule is looking for is in the map and has a value.

 

But I will need to be able to pass null values to the rules (and expect
them to just not fire any rule that looks for that param), however this
always throws a null pointer exception.

 

So my question is: Is there any mechanism to deal with this in drools.

 

Simply setting all nulls to a default value isn't preferable in this
situation as the app is going to be used by several different sources
and has to be able to take in many different types of info.

 

Thanking you,

 

Alex


________________________________________________________________________
Privileged, confidential and/or copyright information may be contained in this communication. This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended addressee, you may not copy, forward, disclose or otherwise use this e-mail or any part of it in any way whatsoever. To do so is prohibited and may be unlawful. If you have received this email in error 
please notify the sender immediately.

Paddy Power PLC may monitor the content of e-mail sent and received for the purpose of ensuring compliance with its policies and procedures.

Paddy Power plc, Airton House, Airton Road, Tallaght, Dublin 24  Registered in Ireland: 16956
________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20090224/141ce4a2/attachment.html 


More information about the rules-dev mailing list