Hi,
You've discovered the correct way to do it; Jess considers the
question mark to not be part of the variable's name. SOrry that the
docs don't mention this. I will add a section describing the proper
use of Variable, FUncallValue and friends. Thanks for letting me know
about this.
I think Richendra Khanna wrote:
>
> Hi all,
>
> I'm a new jess user. Ran into this problem.
>
> in my java code:
>
> SomeClass some_b = new SomeClass();
> Funcall f = new Funcall("bind", rete);
> f.add(new Variable("?*b*", RU.VARIABLE));
> f.add(new Value(some_b));
> f.execute(rete.getGlobalContext());
>
> then somewhere in my jess rules I'm doing
>
> (?*b* getXYZ)
>
> on the RHS, and I get
> "No method named 'getXYZ' found in class java.lang.String."
> when the rule gets fired.
>
> this I guess was because the variable never got bound,
> and nil is treated as a String.
> (I'd initialized the ?*b* in defglobal to nil)
>
> after poking around with it I realized that this works.
>
> f.add(new Variable("*b*", RU.VARIABLE));
>
> is this to be expected? I looked at docs & code for the Variable class and other
> stuff but couldn't make out which way it should be.
>
> Richendra.
> ---------------------------------------------------------------------
> 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]
---------------------------------------------------------------------