此内容没有您所选择的语言版本。
20.8. Salience State Example: Inserting a Dynamic Fact
- For the engine to see and react to changes of fact properties, the application must tell the engine that changes occurred. This can be done explicitly in the rules by using the
modify
statement, or implicitly by letting the engine know that the facts implementPropertyChangeSupport
as defined by the JavaBeans specification. - The above example demonstrates how to use
PropertyChangeSupport
to avoid the need for explicitmodify
statements in the rules. - Ensure that your facts implement
PropertyChangeSupport
, the same way the classorg.drools.example.State
does.