此内容没有您所选择的语言版本。
20.10. Salience State Example: Agenda Group Rules "B to C"
Result:
- By default, all rules are in the agenda group "MAIN".
- The "agenda-group" attribute lets you specify a different agenda group for the rule. Initially, a Working Memory has its focus on the Agenda group "MAIN".
- A group's rules will only fire when the group receives the focus. This can be achieved either by using the method
setFocus()
or the rule attributeauto-focus
. auto-focus
means that the rule automatically sets the focus to its agenda group when the rule is matched and activated. It is this "auto-focus" that enables rule "B to C" to fire before "B to D".- The rule "B to C" calls
setFocus()
on the agenda group "B to D", allowing its active rules to fire, which allows the rule "B to D" to fire.