Hi All,
One convenient architecture for controlling processes in Jess is to create
one or more components whose sole purpose is to abstract the interaction
with the rule engine (Rete object). This abstraction I like to call a
RuleEngineManager. The RuleEngineManager is a facade to the Rete object,
which allows for the application programmer to command the application in
domain specific terminology which wraps the appropriate underlying Jess API
code.
The process flow is something like this:
1. The user interacts with the application.
2. The application interacts with the RuleEngineManager.
3. The RuleEngineManager delegates to helpers such as a:
- WorkingMemoryManager: Manages the high-level working memory processes
such as initialization, rollback, and queries.
- RuleManager: Manages the loading and unloading of rule modules and
focus stack.
4. The delegate performs the assigned task, executing a callback if
necessary.
In the application that I'm currently coding, we have need to rollback the
working memory to a previous state when certain conditions arise.
Of course, Jess provides the WorkingMemoryMarker class and its methods to
provide the State object.
To implement the actual stack of working memory markers in the
WorkingMemoryManager, I've decided to use the *
org.apache.commons.collections.map.LinkedMap*<http://commons.apache.org/collections/apidocs/org/apache/commons/collections/map/LinkedMap.html>,
which allows me to label the markers and keep them in sequential
order.
I thought I'd pass this along as a tip and ask the general question:
Has any one else used this or a similar architectural approach; and, if so,
how did you tackle it?
Cheers,
Jason
-----------------------------------------------------------
Morris Technical Solutions LLC
[EMAIL PROTECTED]
(517) 304-5883