Hi All,
I am trying to pass this simple example write in Jess language in a java program but I am having some problems.
 
This is the sample:
    (deftemplate utenti (slot ID) (slot choice))
 
    (reset)
    (deffacts lista-fatti "Contiene la Knoldge base"
     (prodotto tonno)
     (utenti (ID 1) (choice tonno))
     (utenti (ID 2) (choice tonno))
     (utenti (ID 3) (choice tonno))
     (utenti (ID 4) (choice tonno))
     (utenti (ID 5) (choice pippo))
     (utenti (ID 6) (choice pippo))
     (utenti (ID 7) (choice pippo)))
 
    (defrule CheckDiscount-1
       (prodotto ?x)
       (utenti (scelta ?x))
       =>
       (printout t " Questo acuisto le permette di acquistare 4 confezioni di " ?x " con lo sconto del 20%.
       congratulazioni!!!!" crlf))           
    
        (run)
 
My intention is to load dynamically the facts reading data from a database table. Is it possible?
If I have to insert a thousand facts, do I have to create a thousand different Fact objects? Creating two Fact object with the same name the error message is:

Variable 'fact' is already defined in this method.

How is possible to use the store/fetch methods in this kind of situation?
 
Thank you and sorry for the disturb.
 
Bye
 
--
Matteo Melideo  
Direct Phone: +39 06 44741145 - Operator: +39 06 4474111
Engineering SpA - R&D Lab -, Fax: +39 06 4465981
Viale del Castro Pretorio, 116 E-mail: [EMAIL PROTECTED] or [EMAIL PROTECTED]
00184 Roma - Italy
--

Reply via email to