|
Hi All, I am always having problem with a rules that has to return me more than one value. I have thought that perhaps the best thing to do to manage them was to use the java.util.Hashtable. Just in case I prefer to show you my code. Here it is: ... r.executeCommand ( "(bind ?ht = (new java.util.Hashtable)) (store RESULT ?ht)");r.executeCommand( "(defrule CheckDiscount-1 " + " (prodotto ?x) " + " (utenti (id ?y) (scelta ?x)) " + " => " + " (call ?ht put \"key1\" ?y))" + " (call ?ht put \"key2\" ?x))");r.run(); Hashtable ht = (Hashtable)r.fetch( "RESULT").externalAddressValue(null);for (int y= 1; y < ht.size(); y++) System.out.println("Il Sig. Tizio con Num. Ord " + (Integer)ht.get("key1") + "ha ottenuto 4 scatolette di " + (String)ht.get("key2") + " al 5% di sconto"); The message error returned at run time is this
one:
Jess reported an error in routine call while executing (call ?ht put "key2" ?x). Message: No method named 'put' found in class java.lang.String. Program text: ( call ?ht put "key2" ?x ) at line 0. ... I thank all of you in advance for the help and
apologize 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 -- |
- Re: JESS: Hashtable problem Matteo Melideo
- Re: JESS: Hashtable problem ejfried
