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)))
 
(defquery find-lessons
(declare (variables ?currConc ?diffLevel))
(lesson (difficultyLevel ?p&: (eq ?p ?diffLevel)) ( belongs-to-concept ?s&: (eq ?s ?currConc))))

 

and I need to run query from Java and read values of lesson's slots for all choosen lessons. I have tried to write something like this:
 
 
public void runQueryFindLessons(int currConc, int diffLev) {
try {
ValueVector vv = new ValueVector();
vv.add(new Value(currConc, RU.INTEGER));
vv.add(new Value(diffLev, RU.INTEGER));
Iterator it = engine.runQuery("find-lessons", vv);
System.out.println("Funkcija runQueryFindLessons klase DiscoursePlanner");
try {
   while (it.hasNext()) {
                System.out.println(" in this part I need to read lesson slots");
             }
  }  catch (NoSuchElementException ex) {
     }
       }
catch (JessException je) {
    }
   }

Reply via email to