[rules-users] Rules syntax question using hashmap

Zevenbergen, Alex azevenbergen at paddypower.com
Thu Feb 26 11:45:46 EST 2009


Hi all, 

 

Im using an object called 'Fact' this object has one attribute that is a
hashmap 'details'

 

I know there are several ways to access the parameters in the hashmap

 

$f : Fact()

eval ($f.getDetails().get("END_MATCH").toString() == "true" &&
$f.getDetails().get("WINNER").toString() == "HOME")

    

$f : Fact(details.END_MATCH == true,details.WINNER == "AWAY")

 

$f : Fact()

details(fact == $f, name == "END_MATCH", value == true)

 

 

I was told the third option works but it doesn't for me!

 

Anyway my question is: Is there anyway for these sort of rules to not
through an exception if any of the named parameters aren't on the
hashmap 'details'?

 

Ideally the rule would simply not fire if it looked for a key that
wasn't there!

 

Any info much appreciated

 

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-users/attachments/20090226/e3c323a5/attachment.html 


More information about the rules-users mailing list