I think Karen Fox wrote:
> I am able to store variables from Java into Jess and use them in a batch
> file. I then want to retrieve the multislot list that has been put
> together within this batch file and view the list. I've tried several
> different things, none of which has worked.
>
On the contrary, the example you show below is working fine. listValue
returns a jess.ValueVector object, which Jess uses to represent a
list. ValueVector.toString() prints each object in the list, separated
by spaces. Jess values that contain Java objects print as
<External-Address:Class name>. So taken together,
> Results are
> <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstan
> ce> <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstance>
is doing exactly what it should do. IPLLIST contains two items, each
an instance of edu.stanford.smi.protege.model.DefaultSimpleInstance.
Now, it's not doing what you -want-, and that's another matter. Use
the ValueVector API to loop over the elements of the list, and print
each one in some more acceptable fashion. I don't know anything about
the edu.stanford.smi.protege.model.DefaultSimpleInstance class, or I'd
tell you how to do that; maybe simply printing an instance would work:
System.out.print("Results are ");
ValueVector list = r.fetch("IPLLIST").listValue(null);
for (int i=0; i<list.size(); ++i) {
System.out.print(list.get(i));
System.out.print(" ");
}
System.out.println();
> Here is where I store the list in the clp file:
>
> (defrule complete-search
> (goal-is-to (action "complete") (argument1 $?iplList))
> =>
> (store IPLLIST $?iplList)
> (printout t "We are finished!! " crlf)
> (printout t "Final list is: " crlf)
> (stepIPLList $?iplList)
> )
>
>
> Here is the latest attempt to retrieve the list from Java:
>
> //fetch stored result
> System.out.println("Results are " +
> r.fetch("IPLLIST").listValue(null));
>
> which gives me this error:
>
> Results are
> <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstan
> ce> <External-Address:edu.stanford.smi.protege.model.DefaultSimpleInstance>
>
> I've tried using externalAddressValue(null) and that didn't work either.
> I tried using the Enumeration example from the manual and that didn't
> work. I'm sure I'm doing something very stupid as a newbie, but I'm not
> seeing it. I'd appreciate any suggestions.
>
> Thank you.
>
> --
> Karen Fox
> Technical Project Support III
> The MITRE Corporation
> Colorado Springs, CO
> 719-572-8368
> [EMAIL PROTECTED]
>
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
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]
--------------------------------------------------------------------