Well, a Rete object can send event notifications when working memory is modified, and I suppose you could use those events to synchronize multiple rule engines. You'd have to be rather careful to avoid loops. The JessListener event mechanism is documented in the manual.

On Jul 18, 2007, at 1:31 AM, tanming_tanming wrote:

Thank Ernest ,may be just use one object in the server is good for my system. But ,I still want to know if Jess has the property that I pointed previously: 1)How does other jess objects notes the facts has been modified and to reload it


2007-07-18,"Ernest Friedman-Hill" [EMAIL PROTECTED]
Why would you want "every user to have their own Jess object" if
they're all going to have the same set of rules and facts? If that's
the case, why not just use one object in the server?

On Jul 17, 2007, at 5:33 AM, tanming_tanming wrote:

> Hi,
>
>  I want to use Jess in multi-thread environment,So may be every
> user have it's own Jess Object which has the same JESS facts. At
> the same time ,each user could modify the facts.
>
> Now ,my question is, 1)How does other users notes the facts has
> been modified and to reload it.
>
> By the way, I use jess command "load-facts" to load facts from a
> file and save them with "save-facts".I have pasted some fragment of
> my rules file below.
> In java ,I use RMI as server to run system like this:
>              ............
>              Rete m_rete = new Rete();
>              m_rete.batch("rule.clp");
>              m_rete.run();
>              .................
> Any comments or examples will be very appreciated.
>
> Sincerly,
> Henry,Tan
>
>
> ----------------------------rule.clp------------------------
> (import my.jess.*)
> (deftemplate node  (declare (from-class Node)))
> (defrule initialize-1
>    (not (start))
>    =>
>    (load-facts "animal3.dat")
>      (assert (start)))
> (defrule no-more
>    ?phase <- (no-more)
>    =>
>    (save-facts "animal3.dat" node next-gensym-idx))
> (defrule replace-answer-node
>    ?phase <-(replace-answer-node ?name)
>    ?data <- (node (name ?name)
>                   (type answer)
>                   (answer ?value))
>     ?answer<-(answer ?question)
>    =>
>   ; Create the new learned nodes
>    (bind ?newnode1 (gensym*))
>    (bind ?newnode2 (gensym*))
>    (modify ?data (type decision)
>                  (question ?question)
>                  (yes_node ?newnode1)
>                  (no_node ?newnode2)
>            (answer nil))
>    (assert (node (name ?newnode1)
>                  (type answer)
>                  (answer ?new-animal)))
>    (assert (node (name ?newnode2)
>                  (type answer)
>                  (answer ?value))))
>
> ---------------------------------------------------------------

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify owner-jess- [EMAIL PROTECTED]
--------------------------------------------------------------------



iPod、万 点 巨 额 点 卡、奖 学 金……海 量 奖 品,想 拿 就 拿!

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to