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()?
 
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:-
 
Rule 1
    when
        ObjectA()
        ObjectB()
    Then
        System.out.println("Rule 1 activated");
    end
 
All records
Record 1: ObjectA()
Record 2: ObjectA()
Record 3: ObjectB()
Record 4: ObjectB()
 
Subset 1 (records 1 - 2)
Record 1: ObjectA()
Record 2: ObjectA()
 
Subset 2 (records 3 - 4)
Record 3: ObjectB()
Record 4: ObjectB()
 
If you have two threads asserting each subset to their own WM and firing all rules; "Rule 1" will never be activated.
 
If you have two threads asserting each subset to a shared WM and fire all rules; "Rule 1" will be activated.
 
With kind regards,
 
Mike


From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of shilpa.raghavendra@wipro.com
Sent: 31 May 2007 11:11
To: rules-users@lists.jboss.org
Subject: [rules-users] Need Help on using rules in Multiple Threads

Hi,

 

            I need to know how to use rule engine in multiple thread environment, the situation as given below   

 

            I have to handle huge records nearly 40000 so I will create a thread contains 500 records and run it.

 

            Each thread will execute the rules but I am not getting the expected result.

 

            May be the threads object are conflicting due to multiple thread execution.

 

            Please help me to come out of it

 

Regards

Shilpa

 


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