I think Jeremic Zoran wrote:
[Charset iso-8859-2 unsupported, filtering to ASCII...]
> I have batch file as follow:
> 
> (deftemplate lesson 
> (slot ordinalNumber (type INTEGER))
> (slot ID (type INTEGER))
> (slot difficultyLevel (type INTEGER))
> (slot belongs-to-concept (type INTEGER)))
> 


Each item returned by the iteration is a jess.Token object; a Token
contains jess.Fact objects. The 0th fact is always a special
query-trigger fact, so it's the fact at index 1 that you want. Once
you have a Fact object, you can use the getSlotValue() function to
get the contents of each slot by name, and then use the methods of
jess.Value to get appropriate Java values. So this would look
something like

while (it.hasNext()) {
  Token tok = (Token) it.next();
  Fact fact = tok.fact(1);

  int ordinalNumber = fact.getSlotValue("ordinalNumber").intValue(null);
  int id = fact.getSlotValue("ID").intValue(null);
  int difficultyLevel = fact.getSlotValue("difficultyLevel").intValue(null);
  int belongs = fact.getSlotValue("belongs-to-concept").intValue(null);
  // Now do something with the values...
}

---------------------------------------------------------
Ernest Friedman-Hill  
Science and Engineering PSEs        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]
--------------------------------------------------------------------

Reply via email to