|
Folks:
At present, I'm considering Jess as the
implementation language for a process-rule checker --specifically for MEMS
design. Anyway, it seems, from the documentation, that I may approach GUI design
from two directions: Either implement the GUI in Java and utilize the Rete
inferencing engine as a "library" or implement the GUI in Jess. I have been a
LISP programmer for over twenty years, but am also Java literate ... I don't
have any preference, per se ... all right, I'd prefer LISP syntax, but it's not
a show-stopper.
Okay. So, I create a simple JFrame with some
menus and some graphics. Now, I have defined a defquery whose sole purpose is to
cons-up a list of Materials (this is a pattern that I expect will be repeated
throughout the application).
Say something like:
(defquery findAllMaterials "
...."
(Equipment ...))
"Batching" the "clp" file that contains this form
plus a bunch of Materials seems to work just fine. In Jess, I can
run:
(bind ?materials (run-query
findAllMaterials))
and I get back a structure that I can treat as an
Enumeration:
(while (?materials hasMoreElements)
...)
Now, I'd like to retrieve that Enumeration and use
it within my Java code, perhaps to populate a drop-down list of
Materials:
Value value=m_rete.executeCommand("(run-query
findAllMaterials)");
What I get back looks like a
java.util.Vector$<some-address> .... after calling the appropriate
externalAddressValue function --to which I also provide the current Rete
engine's context, although I surmise that this value is ignored. Unfortunately,
I cannot really use this thing as a Java Vector. I cannot even typecast it to a
Vector, for that matter.
Clearly, I've misunderstood something here. So, if
anyone has any idea of what I'm talking about, I'd appreciate a
hint.
Thanks,
TomR
|
- Re: JESS: run-query results ... Tom Reinhardt
- Re: JESS: run-query results ... ejfried
