[rules-users] Question on setting globals

Seema Richard Seema.Richard at ust-global.com
Thu Apr 10 08:05:01 EDT 2008


Hi,

 

I've been reading the Drools documentation where it is mentioned that
"It is strongly discouraged to set (or change) a global value from
inside your rules. We recommend to you always set the value from your
application using the working memory interface." What is the reason for
this?

Also, in the example shown, are you not modifying the global? Isn't it
what is discouraged?

*                global java.util.List myGlobalList;
*                 
*                rule "Using a global"
*                when
*                    eval( true )
*                then
*                    myGlobalList.add( "Hello World" );
*                end

Thanks,

Seema

 

 

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


More information about the rules-users mailing list