JESS: Slot names in userfunction

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

JESS: Slot names in userfunction

Vladimir Florian

Is there any means that in a userfunction to find out the slot names of an unordered fact together with the slot values and to put them in a list?

Thanks for any suggestion

Vladimir

Reply | Threaded
Open this post in threaded view
|

Re: JESS: Slot names in userfunction

friedman_hill ernest j
I think Vladimir Florian wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Is there any means that in a userfunction to find out the slot names of an unordered fact together with the slot values and to put them in a list?
>

Yes. Call getDeftemplate() to get the Deftemplate for the Fact. Then
use Deftemplate.getNSlots() and Deftemplate.getSlotName(int) to get
the names of the slots, and then use those names and the
getSlotValue() method to get the slot values from the Fact.

---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [hidden email]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
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].
--------------------------------------------------------------------