Title: RE: JESS: JESS and instances

> > How can I share facts between different instances of Rete?
>
> You can duplicate them, but not share them.

However, you can share (via definstance) an instance of a java object between two instances of Rete. Your question was about "facts" which, as Ernest pointed out, cannot be shared.

You could do this like so:

MyObject sharedInstance = new MyObject(); // whatever...
Rete rete1 = new Rete();
Rete rete2 = new Rete();
configure( rete1 ); // define/declare "MyObject" type to jess - see defclass/import
configure( rete2 ); // same...
rete1.definstance( "MyObject", sharedInstance, true );
rete2.definstance( "MyObject", sharedInstance, true );

This could be useful in some circumstances, I suppose, but it is not a common practice.

alan

Reply via email to