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

大城市里の小女人 提交于 2019-12-06 23:06:51

问题


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

回答1:


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,



来源:https://stackoverflow.com/questions/17042437/what-is-the-difference-between-no-loop-and-lock-on-active-in-drools

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!