[rules-users] About FactHandle

Anstis, Michael (M.) manstis1 at ford.com
Thu Oct 4 07:20:26 EDT 2007


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 at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of
prateek.katiyar at wipro.com
Sent: 04 October 2007 10:57
To: rules-users at 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
	

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071004/2394d4eb/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4159 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20071004/2394d4eb/attachment.bin 


More information about the rules-users mailing list