<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3132" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=394061611-04102007><FONT face=Arial
color=#0000ff size=2>As per the documentation:-</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=394061611-04102007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=394061611-04102007><FONT
face="Century Schoolbook" color=#0000ff size=2>"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.
</FONT></SPAN></DIV>
<DIV><SPAN class=394061611-04102007><FONT face="Century Schoolbook"
color=#0000ff size=2> <BR>new List list = new
ArrayList;<BR>workingMemory.setGlobal("list",
list);<BR> <BR>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".</FONT></SPAN></DIV>
<DIV><SPAN class=394061611-04102007><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=394061611-04102007>From
this I take that they are not inserted implicitly.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=394061611-04102007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=394061611-04102007>From
what I understand Globals are not Facts and hence do not have
FactHandles.</SPAN></FONT></DIV>
<DIV dir=ltr align=left><SPAN class=394061611-04102007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> rules-users-bounces@lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] <B>On Behalf Of
</B>prateek.katiyar@wipro.com<BR><B>Sent:</B> 04 October 2007
10:57<BR><B>To:</B> rules-users@lists.jboss.org<BR><B>Subject:</B>
[rules-users] About FactHandle<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV id=idOWAReplyText90362 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Hi</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>I am using Drools 4.0.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>As per the Drools 4.0 documentation if we
are declaring a object as <STRONG><FONT color=#0000ff>global</FONT></STRONG>
then we can not use <STRONG><FONT color=#0000ff>"insert(java.lang.Object
Object)"</FONT></STRONG> method on this object.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>It will be inserted implecetly.Now if we
want to <STRONG><FONT color=#0000ff>update</FONT></STRONG> this object in the
RHS part of our rule file then we need the <STRONG><FONT
color=#0000ff>"FactHandle"</FONT></STRONG> for the object.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>Now as we know that the return type of
<STRONG><FONT color=#0000ff>"setGlobal(java.lang.String identifier,
java.lang.Object value)"</FONT></STRONG> method is <STRONG><FONT
color=#0000ff>"void"</FONT>.</STRONG></FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>So please tell me that how can i update
this object in my rule file?<FONT
face="Times New Roman"> </FONT><BR></FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>Thanks.</DIV></FONT>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2></FONT> </DIV></DIV>
<DIV id=idSignature45747 dir=ltr>
<DIV><FONT face=Arial><EM><STRONG>With Regards</STRONG></EM></FONT></DIV>
<DIV><FONT face=Arial><EM><STRONG>Prateek
Katiyar</STRONG></EM></FONT></DIV></DIV>
<TABLE>
<TBODY>
<TR>
<TD bgColor=#ffffff><FONT color=#000000><BR>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. <BR><BR>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.<BR><BR>www.wipro.com<BR></FONT></TD></TR></TBODY></TABLE></BLOCKQUOTE></BODY></HTML>