[rules-users] populating global variable in Condition Section?

Greg Barton greg_barton at yahoo.com
Fri Aug 21 16:44:25 EDT 2009


This is a galactically bad idea.  Using a global in this way is inherently unsafe as there's no guarantee that ebtween the time you set the var and when it's used later in the condition that the value is the same.  What is your reason for wanting to use a global in this way?  You should use a temporary bound variable instead.

--- On Fri, 8/21/09, Shah, Malay <Malay.Shah at morganstanley.com> wrote:

> From: Shah, Malay <Malay.Shah at morganstanley.com>
> Subject: [rules-users] populating global variable in Condition Section?
> To: rules-users at lists.jboss.org
> Date: Friday, August 21, 2009, 3:19 PM
> 
> 
>  
>  
> 
> 
> Hi,
>  
> Is it possible 
> to populate a global variable in
> the condition section of the 
> drool rule, and use it later in the condition itself?
> I currently have a 
> global HashSet variable that I construct before firing
> the rule, but I 
> would like this code of constructing this global variable
> to be with the drool 
> rule itself. Any help on this would be much
> appreciated.
>  
> Thanks
>  
> Malay
> 
> 
> 
> NOTICE: If received in error, please
> destroy, and notify sender. Sender does not intend to waive
> confidentiality or privilege. Use of this email is
> prohibited when received in error. We may monitor and store emails to the extent
> permitted by applicable law.
>  
> 
> -----Inline Attachment Follows-----
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 


      




More information about the rules-users mailing list