drools rule (a) properties

Rules property declaration provides a way to influence the rules of behavior. Some are simple, others are part of a complex subsystem rules streams. Get the most from Drools, you should ensure that there is proper understanding of each property.

Attributes Types of Defaults Meaning
no-loop Boolean false  

When the result of the rule changes the fact, it may lead to the activation rules again, resulting in an infinite loop. The no-loop set to true will skip this fact with the rule set to create another Activation.

ruleflow-group String N/A

Ruleflow Drools is a feature that allows you to control the trigger rule. Triggered by the same ruleflow-group identifier rule set only when it is active.

 

agenda-group String MAIN agenda-group allows the user to group agenda, thereby providing more execution control. When the agenda-group receives focus agenda-group of the same rule to be matched.
auto-focus Boolean false auto-focus (auto focus acquisition) is set to true when the rule is activated, agenda-group if not matched by the rule to obtain a focus, the focus is automatically acquired. That is, once the auto-focus set ture, then agenda-group will be located with the rule of the rule activation to acquire focus.

lock-on-active

Boolean false When a ruleflow-group is activated or agenda-group receives focus, which lock-on-active labeled rule true will be locked and can not be activated, regardless of the fact been modified many times, matching the rule will be discarded. This is a more stringent no-loop, compared to the no-loop, the property is the first true rule will not be matched. Only when the rule-group quit activate or agenda-group loses focus, the rule will be matched again in the state.
activation-group String N/A 属于同一activation-group(激活组)的规则(由此属性的字符串值标识)将仅以独占方式触发。更确切地说,要激活的激活组中的第一个规则将取消组中所有规则的所有未决激活,即阻止它们触发。
salience integer 0

规则排序,等待匹配的规则队列将salience的值由高到低排列,salience高的规则,会优先获得匹配。

 

dialect String 在package中指定默认值。可能的值:“java”或“mvel” dialect(方言种类)是用于LHS或RHS代码块中的任何代码表达式的语言。目前有两种方言,Java和MVEL。虽然可以在包级别指定方言,但此属性允许为规则覆盖包定义。
date-effective String N/A 有效期。只有当前日期和时间在date-effective之后时,才能激活规则。
date-expires String N/A 失效期。如果当前日期和时间在date-expires属性之后,则无法激活规则。
duration long   激活间隔。如果一个规则匹配为ture时,经过duration的时间间隔后再次匹配,如果仍然为true则执行规则then。
enabled boolean true 当enabled为false时,即使规则匹配也不会执行。需要注意的是,即使该属性设置为false,仍然会参与匹配,会对性能产生影响。

 

Guess you like

Origin blog.csdn.net/top_explore/article/details/93635908