Re: JESS: Problem calling java methods from Jess with Object parameters
I think Richard, Kevin R. wrote: > Yup, my mistake; the first argument should be '?elem'. Here is the > constructor: > > public void MyObject(MyObject parent, String type) That's not a constructor -- it's a method returning void whose name just happens to be the same as the class. You couldn't construct an object with this from Java code, either. Remove that "void" and you should be OK. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov 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]
RE: JESS: Problem calling java methods from Jess with Object parameters
Yup, my mistake; the first argument should be '?elem'. Here is the constructor: public void MyObject(MyObject parent, String type) { setType(type); this.parent = parent; } I'm using version 70b1. Thanks. - Kevin -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, August 30, 2005 10:21 AM To: jess-users@sandia.gov Subject: Re: JESS: Problem calling java methods from Jess with Object parameters I think Richard, Kevin R. wrote: > ;; Jess complains about not finding the constructor > (bind ?thickness_throw (new MyObject elem > "PDF_ATR_MARKING_LINE_CURVE")) > > The rule above attempts to generate a new object using the object that > I retrieved from the fact as an argument to its constructor. However, > Jess can't find the constructor. In the constructor call, that ought to be the variable "?elem", not the symbol "elem", right? If this is just a typo in your email, as opposed to the rule itself, then can you show me the declaration of the constructor you're trying to call, and also let me know what version of Jess you're using? - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov 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] 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]
Re: JESS: Problem calling java methods from Jess with Object parameters
I think Richard, Kevin R. wrote: > ;; Jess complains about not finding the constructor > (bind ?thickness_throw (new MyObject elem "PDF_ATR_MARKING_LINE_CURVE")) > > The rule above attempts to generate a new object using the object that I > retrieved from the fact as an argument to its constructor. However, > Jess can't find the constructor. In the constructor call, that ought to be the variable "?elem", not the symbol "elem", right? If this is just a typo in your email, as opposed to the rule itself, then can you show me the declaration of the constructor you're trying to call, and also let me know what version of Jess you're using? - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov 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]