This was a useability bug, of sorts, in an earlier version of
Jess. It's been discussed on this list, and is no longer a problem in
current versions of Jess. See, for example,
http://www.mail-archive.com/[email protected]/msg02596.html . Note
that the mail archive has a nice search feature.
If you want a patch for Jess 6.0a3/4/5 or so, replace the
fact-slot-value function in jess/scriptlib.clp with this one:
(deffunction fact-slot-value (?__fact ?__name)
"Fetch the value from the named slot of the given fact"
(return (call ?__fact getSlotValue ?__name)))
I think Bruno SINTES wrote:
> Hi,
> I've got a question concerning the right use of the (fact-slot-value)
> function.
> Here is what I enter in the engine :
>
> (deftemplate type-module
> (slot module)
> (slot sorte))
>
> (assert (type-module (module FXINT) (sorte CP)))
> ...
>
> (defrule test
> ?corres <-(type-module (module FXINT))
> =>
> (assert (module-is-found-and-sort-is (fact-slot-value ?corres sorte))))
>
> ...
>
> and at the runtime, Jess raises an exception saying :
> Jess reported an error in routine call while executing (call (engine)
> findFactByID ?__fact-id) while executing (bind ?__fact (call (engine)
> findFactByID ?__fact-id)) while executing deffunction fact-slot-value
> while executing (fact-slot-value ?corres sorte) while executing (assert
> (module-is-found-and-sort-is (fact-slot-value ?corres sorte))) while
> executing defrule test while executing (run).
> Message: No overloading of method 'findFactByID' in class jess.Rete I
> can call with these arguments: (call (engine) findFactByID ?__fact-id).
>
> When I run manually (fact-slot-value 1 sorte) that works fine. It looks
> like the fact-id I get in the LHS isn't the good type.
> So, how can I get the fact-id working in the function ?
>
>
> Thanks,
> B.SINTES
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------