[rules-users] Rules syntax question using hashmap

Zevenbergen, Alex azevenbergen at paddypower.com
Thu Feb 26 12:14:15 EST 2009


Hi,
I get the following error: Unable to resolve ObjectType 'details'

I've tried different variations (getDetails etc) but 'details is my
attribute name and doesn't seem to be picked up!

alex
-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Greg Barton
Sent: 26 February 2009 17:04
To: Rules Users List
Subject: Re: [rules-users] Rules syntax question using hashmap

Can you provide any info on why the third option doesn't work?

--- On Thu, 2/26/09, Zevenbergen, Alex <azevenbergen at paddypower.com>
wrote:

> From: Zevenbergen, Alex <azevenbergen at paddypower.com>
> Subject: [rules-users] Rules syntax question using hashmap
> To: rules-users at lists.jboss.org
> Date: Thursday, February 26, 2009, 10:45 AM
> 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
>
________________________________________________________________________
_______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


      
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

________________________________________________________________________
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
________________________________________________________________________




More information about the rules-users mailing list