Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the difference between no-loop and lock-on-active in drools

Tags:

drools

Here is an example of a rule that uses "no-loop":

rule "Even Number Rule"   
dialect "java"  
no-loop  
      when  
       n : Number( number !=0 && (number%2)==0 , value : number)  
    then  
        modify(n){setNumber(8)};  
      end
like image 687
Anil Kumar Avatar asked Jun 11 '13 10:06

Anil Kumar


1 Answers

Long story short:

  • no-loop: avoid the re-activation of a rule caused by the RHS of that SAME rule.
  • lock-on-active: avoid the re-activation of a rule NO MATTER what the cause is.

Long story: http://ilesteban.wordpress.com/2012/11/16/about-drools-and-infinite-execution-loops/

Hope it helps,

like image 131
Esteban Aliverti Avatar answered Oct 13 '22 22:10

Esteban Aliverti