What are Recursion Rules. Any example

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

What are Recursion Rules. Any example

ashwindrool
Hi All,

Can anyone help me in understanding "Recursion Rules".

If any example , will be of great help to me.


Thanks
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] What are Recursion Rules. Any example

salaboy
Hi, why do you want to understand that? What are you trying to solve? Help us to help you. 

Usually when the terms "Rules Recursion" is used, is when you have a rule or a set of rules that are executed in a loop because the consequence of a rule trigger the same rule again. This can be caused because your rule consequence, is modifying the objects that are matched in the Condition side of the rule, which causes the re evaluation of the condition.

Is that what are you looking for?

Cheers


On Tue, Aug 20, 2013 at 9:56 AM, ashwindrool <[hidden email]> wrote:
Hi All,

Can anyone help me in understanding "Recursion Rules".

If any example , will be of great help to me.


Thanks



--
View this message in context: http://drools.46999.n3.nabble.com/What-are-Recursion-Rules-Any-example-tp4025617.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] What are Recursion Rules. Any example

ge0ffrey
Administrator
rule "infection spreads"
when
 $a : Person (infected = true)
 $b : Person (infected = false, within100meters($a) = true)
then
 modify ($a) { infected = true }
end



On 20-08-13 11:00, Mauricio Salatino wrote:
Hi, why do you want to understand that? What are you trying to solve? Help us to help you. 

Usually when the terms "Rules Recursion" is used, is when you have a rule or a set of rules that are executed in a loop because the consequence of a rule trigger the same rule again. This can be caused because your rule consequence, is modifying the objects that are matched in the Condition side of the rule, which causes the re evaluation of the condition.

Is that what are you looking for?

Cheers


On Tue, Aug 20, 2013 at 9:56 AM, ashwindrool <[hidden email]> wrote:
Hi All,

Can anyone help me in understanding "Recursion Rules".

If any example , will be of great help to me.


Thanks



--
View this message in context: http://drools.46999.n3.nabble.com/What-are-Recursion-Rules-Any-example-tp4025617.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] What are Recursion Rules. Any example

Sonata
Usually when you modify or insert inside the RHS then you open the door to recursion.

e.g.
rule loop
when
not Object()
then
System.out.println("Hi");
insertlogical(new Object());
end