Show Table of Contents
20.8. Salience State Example: Inserting a Dynamic Fact
// By setting dynamic to TRUE, JBoss Rules will use JavaBean // PropertyChangeListeners so you don't have to call modify or update(). final boolean dynamic = true; session.insert( fact, dynamic );
- 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
modifystatement, or implicitly by letting the engine know that the facts implementPropertyChangeSupportas defined by the JavaBeans specification. - The above example demonstrates how to use
PropertyChangeSupportto avoid the need for explicitmodifystatements in the rules. - Ensure that your facts implement
PropertyChangeSupport, the same way the classorg.drools.example.Statedoes.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.