As per the documentation:-
"Globals are named objects that can be passed in to the rule engine; without
needing to assert them. Most often these are used for static information, or
services that are used in the RHS of a rule, or perhaps a means to return
objects from the rule engine.
new List list = new ArrayList;
workingMemory.setGlobal("list", list);
The global definition must be defined in the Rule Base and of the same type,
otherwise a runtime exception will be thrown. If a rule evaluates on a
global before you set it you will get a NullPointerException".
From this I take that they are not inserted implicitly.
From what I understand Globals are not Facts and hence do not have
FactHandles.
_____
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of
prateek.katiyar(a)wipro.com
Sent: 04 October 2007 10:57
To: rules-users(a)lists.jboss.org
Subject: [rules-users] About FactHandle
Hi
I am using Drools 4.0.
As per the Drools 4.0 documentation if we are declaring a object as global
then we can not use "insert(java.lang.Object Object)" method on this object.
It will be inserted implecetly.Now if we want to update this object in the
RHS part of our rule file then we need the "FactHandle" for the object.
Now as we know that the return type of "setGlobal(java.lang.String
identifier, java.lang.Object value)" method is "void".
So please tell me that how can i update this object in my rule file?
Thanks.
With Regards
Prateek Katiyar
The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.
www.wipro.com