JESS: Jess interacting with objects instantiated in Java

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

JESS: Jess interacting with objects instantiated in Java

Matt Hutchinson
G'day everyone,

Before you all roll your eyes, I have read through the "Jess in
Action" book and the online documentation - but I'm still a bit
puzzled.

I understand that Jess can instantiate regular classes that are
Javabean compliant, and also that objects can be sent/fetched between
Java and Jess. I will be using the Jess API in a Java application and
my question is how can I create an (javabean compliant) object in
"ordinary java" i.e. main memory and have Jess monitor it in it's
memory.

One example I saw (by using the "dynamic" option) meant that when Jess
made a change to the object, it automatically updated the object's
property (and vice versa). But that object is only in Jess's memory
isn't it? HOW would I get this dynamic link going between an object in
regular memory AND the facts/rules in Jess?


Hope my question makes sense - I've probably just missed the point somewhere!
Cheers,
Matt



--
Matthew Hutchinson
Ph.D. Candidate

Department of Spatial Sciences
Curtin University of Technology
GPO Box U1987
Perth, Western Australia 6845


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

Reply | Threaded
Open this post in threaded view
|

Re: JESS: Jess interacting with objects instantiated in Java

Mitch Christensen
Your java object (bean) resides on the java heap, an associated shadow
fact resides in Jess's working memory.

You can either create your bean external to jess and assert via Jess's
java API, or you can create the object within Jess.  Either method will
result in a shadow fact in working memory and an associated java object
on heap.

Assuming you have properly implemented the java.beans property change
support on your bean, changes made to the java object will be reflected
in the shadow fact.

-Mitch

Matthew Hutchinson wrote:

>G'day everyone,
>
>Before you all roll your eyes, I have read through the "Jess in
>Action" book and the online documentation - but I'm still a bit
>puzzled.
>
>I understand that Jess can instantiate regular classes that are
>Javabean compliant, and also that objects can be sent/fetched between
>Java and Jess. I will be using the Jess API in a Java application and
>my question is how can I create an (javabean compliant) object in
>"ordinary java" i.e. main memory and have Jess monitor it in it's
>memory.
>
>One example I saw (by using the "dynamic" option) meant that when Jess
>made a change to the object, it automatically updated the object's
>property (and vice versa). But that object is only in Jess's memory
>isn't it? HOW would I get this dynamic link going between an object in
>regular memory AND the facts/rules in Jess?
>
>
>Hope my question makes sense - I've probably just missed the point somewhere!
>Cheers,
>Matt
>
>
>
>  
>

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

Reply | Threaded
Open this post in threaded view
|

Re: JESS: Jess interacting with objects instantiated in Java

friedman_hill ernest j
I think Mitch Christensen wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Your java object (bean) resides on the java heap, an associated shadow
> fact resides in Jess's working memory.
>
> You can either create your bean external to jess and assert via Jess's
> java API, or you can create the object within Jess.  Either method will
> result in a shadow fact in working memory and an associated java object
> on heap.

More specifically, for Matthew's benefit, you can use the
definstance() method in the jess.Rete class; it's entirely equivalent
to the (definstance) function you use within Jess.



---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [hidden email]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

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