Multislot and queries

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Multislot and queries

mike donald
This post was updated on .
hello,
I am a beginner in jess, I'm stuck on my application since
I have two deftemplates

(deftemplate Individu
         (slot age)
         (slot sexe)
         (multislot visites (default (create$) ) )
)

(deftemplate Visite
        (slot id_visite)
        (slot nom)
        (slot pr)
)

I have the following query:

(defquery objetHistogramme
       ?i <- (Individu {sexe != F } (age ?ag) (sexe ?sex) (visites $?visites))
)

In my java program, I call my query as follows:

QueryResult result = engine.runQueryStar("objetHistogramme", new ValueVector());
   while (result.next()) {
                int x  = result.getInt("ag");    //age
               
                Object v = result.getObject("visites");     // Erroorrrrrrrrrr is it

 }

I get an error when I want to retrieve the elements of multislot "visit" to the display.
i
How to recover the multislot?

I wish I could go through the list of the elements of multislot "visites"
how to do this?

Mike
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JESS: [EXTERNAL] Multislot and queries

Friedman-Hill, Ernest
Use QueryResult.get("visites") and then call listValue() on the result.

On 4/8/13 1:05 PM, "mike donald" <[hidden email]> wrote:

>hello,
>I am a beginner in jess, I'm stuck on my application since
>I have two deftemplates
>
>(deftemplate Individu
>         (slot age)
> (slot sexe)
>         (multislot visites (default (create$) ) )
>)
>
>(deftemplate Visite
>        (slot id_visite)
>        (slot nom)
>        (slot pr)
>)
>
>I have the following query:
>
>(defquery objetHistogramme
>       ?i <- (Individu {sexe != F } (age ?ag) (sexe ?sex) (visites
>$?visites))
>)
>
>In my java program, I call my query as follows:
>
>QueryResult result = engine.runQueryStar("objetHistogramme", new
>ValueVector());
>   while (result.next()) {
>                int x  = result.getInt("ag");    //age
>                
>                Object v = result.getObject("visites");     //
>Erroorrrrrrrrrr is it
>
> }
>
>I get an error when I want to retrieve the elements of multislot "visit"
>to
>the display.
>How to recover the multislot?
>
>
>Mike
>
>
>
>
>--
>View this message in context:
>http://jess.2305737.n4.nabble.com/Multislot-and-queries-tp4654137.html
>Sent from the Jess mailing list archive at Nabble.com.
>--------------------------------------------------------------------
>To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
>in the BODY of a message to [hidden email], NOT to the list
>(use your own address!) List problems? Notify [hidden email].
>--------------------------------------------------------------------



--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
in the BODY of a message to [hidden email], NOT to the list
(use your own address!) List problems? Notify [hidden email].
--------------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JESS: [EXTERNAL] Multislot and queries

mike donald
This post has NOT been accepted by the mailing list yet.

Hi Dr Hill,
thank you for the help, I solved the problem.

Mike
Loading...