If the Java caller can supply the object, you could simply put it into a Variable, put the Variable into the jess.Context and call a Jess function to pass that object to the function. Alternatively there are the Rete store() and fetch() methods for passing things in/out of the engine.

But if the Java code can't or won't supply the object deliberately, this is pretty much the same problem as doing this from Java code, without Jess involved at all -- that is to say, not possible, as far as I know (except by using extreme measures like the Java VM debugger interface).



On Jul 29, 2009, at 11:26 AM, David Scuse wrote:

I recently came across a problem that I can't solve using the (excellent) Jess API.

I want to obtain an object (actually a DAO) from the application that calls Jess
which then calls a user function.

A Java stack trace allows me to determine the class names but not the class objects
of the classes that called Jess which then called the user function.
(And I can't think of anything in the reflection package that would give me an object.)

Other than using a static variable that contains the object (or a suitable proxy), the only way that I can see to solve the problem is to add the object (or a proxy)
to the Jess working memory.
(Registering the application, for example with a userID, would still require
a token to be added to working memory.)

I suspect that this must be common problem in large systems
but I can't find anything in the Jess API that will give me an appropriate handle.
Any suggestions would be appreciated.

Thanks

David Scuse
Department of Computer Science
University of Manitoba

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs
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