{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Jess71p2 34 - process You can also actively tell Jess to...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
5. Working Memory 26 process. You can also actively tell Jess to refresh its knowledge of the properties of individual objects using the jess.Rete.updateObject(java.lang.Object) method. This behaviour is what you get for objects that don't support property change notification. In practice, this is fine. Most rule-based programs reason about static "value" objects whose properties don't change over time, or change only occasionally or at well-defined times. But if your objects will be changed often from outside of Jess, then it would be nice to have updates happen automatically. If you want to have your shadow facts stay continuously up to date, Jess needs to be notified whenever a Bean property changes. For this to happen, the Bean has to support the use of java.beans.PropertyChangeListener s. For Beans that fulfill this requirement Jess will automatically arrange for working memory to be updated every time a property of the Bean changes. We can modify our Account class to support this feature like this:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online