<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR>
<STYLE>@page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; }
P.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
LI.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
DIV.MsoNormal {
        FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman"
}
A:link {
        COLOR: blue; TEXT-DECORATION: underline
}
SPAN.MsoHyperlink {
        COLOR: blue; TEXT-DECORATION: underline
}
A:visited {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.MsoHyperlinkFollowed {
        COLOR: purple; TEXT-DECORATION: underline
}
SPAN.EmailStyle17 {
        COLOR: windowtext; FONT-FAMILY: Arial
}
DIV.Section1 {
        page: Section1
}
</STYLE>
</HEAD>
<BODY lang=EN-US vLink=purple link=blue>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>I assume (from "...each thread will execute the rules...")
your threads have their own workingmemory and once you've loaded the 500 records
you call fireAllRules()?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>If this is the case then the activations should be correct
for the subset of records asserted but this could differ to the results you
expected; for example:-</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Rule 1</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2> when</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>
ObjectA()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>
ObjectB()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2> Then</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>
System.out.println("Rule 1 activated");</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007> <FONT
face=Arial color=#0000ff size=2>end</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>All records</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Record 1: ObjectA()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Record 2: ObjectA()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Record 3: ObjectB()</FONT></SPAN></DIV>Record 4:
ObjectB()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Subset 1 (records 1 - 2)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Record 1: ObjectA()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Record 2: ObjectA()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Subset 2 (records 3 - 4)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Record 3: ObjectB()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Record 4: ObjectB()</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>If you have two threads asserting each subset to their own
WM and firing all rules; "Rule 1" will never be activated.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>If you have two threads asserting each subset to a shared
WM and fire all rules; "Rule 1" will be activated.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>With kind regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=256121610-31052007><FONT face=Arial
color=#0000ff size=2>Mike</FONT></SPAN></DIV><FONT face=Arial color=#0000ff
size=2></FONT><FONT face=Arial color=#0000ff size=2></FONT><FONT face=Arial
color=#0000ff size=2></FONT><FONT face=Arial color=#0000ff size=2></FONT><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>shilpa.raghavendra@wipro.com<BR><B>Sent:</B> 31 May 2007
11:11<BR><B>To:</B> rules-users@lists.jboss.org<BR><B>Subject:</B>
[rules-users] Need Help on using rules in Multiple
Threads<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV class=Section1>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi,</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
I need to know how to use rule engine in multiple thread environment, the
situation as given below </SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
I have to handle huge records nearly 40000 so I will create a thread contains
500 records and run it.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Each thread will execute the rules but I am not getting the expected
result.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
May be the threads object are conflicting due to multiple thread
execution.</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
Please help me to come out of it</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Regards</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Shilpa</SPAN></FONT></P>
<P class=MsoNormal><FONT face=Arial size=2><SPAN
style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN></FONT> </P></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>