How Do I Use a Property Change Listener in Oracle Business Rules?
The Oracle Rules Engine supports the Java PropertyChangeListener design pattern. This allows an instance of a Java fact that uses the PropertyChangeSupport class to automatically notify the Oracle Rules Engine when property values have changed. Java facts are not required to implement this pattern to be used by Oracle Rules Engine. Normally, changes made to values of a property of a Java object that has previously been asserted to the Oracle Rules Engine requires that the object be re-asserted in order for rules to be reevaluated with the new property value. For properties that fire PropertyChangeEvents, changing the value of those properties both changes the value and re-asserts the fact to the Oracle Rules Engine. To implement the PropertyChangeListener design pattern in a class, do the following: • Import this package in the class: import java.beans.PropertyChangeSupport; • Add a private member variable to the class: private PropertyChangeSupport m_pcs = null; • In the constructor,