On Nov 2, 2006, at 1:29 PM, Skeptic 2000 wrote:


Let's say I have something like :

(defclass xyz x.y.com.XYZ)

(defrule "x"
 ?x<-(xyz)
=>
(...)

In the RHS, I would like to call a method that is not a bean get/ set on the matched 'xyz', what would be the proper way? (If possible, this method would take a string as argument)


?x is a jess.Fact object; it has a slot named OBJECT containing the actual XYZ object. So you could say

((?x getSlotValue OBJECT) theMethodName "the argument")

Alternatively, you could bind the OBJECT slot on the LHS, and then you'd have a variable on which you could call the method directly.

---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550                 http://www.jessrules.com

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

Reply via email to