[rules-users] Rules with from always loops (Drools 4.0.7)

Przemysław Różycki P.Rozycki at amg.net.pl
Fri Feb 13 04:12:35 EST 2009


Hello,

Doesn't really anyone have any logical explanation of why such a rule loops?

To remind the rule:

rule "Hello World"
         no-loop
         when
                 $fact1 : MyFactBean1(  )
                 $fact2 : MyFactBean2(  ) from $fact1
         then
                 System.out.println("Fired!!!");
                 update($fact1);
end

If I don't use 'from' everything is fine.
I really didn't find in a documentation, that 'from' causes any special 
behaviour of the rule looping.

Best regards,
-- 
Przemysław Różycki
AMG.net, A Bull Group Company
ul. Łąkowa 29
90-554 Łódź
www.amg.net.pl



Przemysław Różycki pisze:
> Thanks for answer, Vikrant, but I don't think so. I have always used 
> no-loop without any additions and it worked (when I didn't use from). 
> BTW, if you comment a condition with from, then the rule does not loop. 
> I also checked with "no-loop true" and result is the same.
> 
> Best regards,
> Przemek
> 
> Vikrant Yagnick pisze:
>> I have to quickly recheck the documentation by I think you have to 
>> write "no-loop true". Just writing no-loop defaults to false I guess.
>>
>> -----Original Message-----
>> From: rules-users-bounces at lists.jboss.org 
>> [mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Przemyslaw 
>> Rózycki
>> Sent: Tuesday, February 10, 2009 3:24 PM
>> To: Rules Users List
>> Subject: [rules-users] Rules with from always loops (Drools 4.0.7)
>>
>> Hello,
>>
>> why does such a rule always loop? Even if no-loop is used?
>>
>> rule "Hello World"
>>         no-loop
>>         when
>>                 $fact1 : MyFactBean1(  )
>>                 $fact2 : MyFactBean2(  ) from $fact1
>>         then
>>                 System.out.println("Fired!!!");
>>                 update($fact1);
>> end
>>
>> The full code of my test application and drl is attached.
>>
>> Best regards,
>> -- 
>> Przemysław Różycki
>> AMG.net, A Bull Group Company
>> ul. Łąkowa 29
>> 90-554 Łódź
>> www.amg.net.pl
>>
>>
>> MASTEK LTD.
>> Mastek is in NASSCOM's 'India Top 20' Software Service Exporters List.
>> In the US, we're called MAJESCOMASTEK
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
>>
>> Opinions expressed in this e-mail are those of the individual and not 
>> that of Mastek Limited, unless specifically indicated to that effect. 
>> Mastek Limited does not accept any responsibility or liability for it. 
>> This e-mail and attachments (if any) transmitted with it are 
>> confidential and/or privileged and solely for the use of the intended 
>> person or entity to which it is addressed. Any review, 
>> re-transmission, dissemination or other use of or taking of any action 
>> in reliance upon this information by persons or entities other than 
>> the intended recipient is prohibited. This e-mail and its attachments 
>> have been scanned for the presence of computer viruses. It is the 
>> responsibility of the recipient to run the virus check on e-mails and 
>> attachments before opening them. If you have received this e-mail in 
>> error, kindly delete this e-mail from desktop and server.
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
>>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
> 
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
> 





More information about the rules-users mailing list