Folks,
I think I may have run into a possible bug in Jess 4.4. On the other
hand, I could just be doing something daft and not realising it.
I am trying to invoke the (call) function on a Java static method. This
method takes a single argument, an array of bytes.
In the rules, this argument can be one of two pre-defined multivariable
values, call them $?arrayA and $?arrayB. Now, I can call the method
using the following syntax:
(call mypackage.myclass mymethod $?arrayA)
That works fine. However, I want to select the argument to pass
depending on the value of another variable, call it ?myvar:
(bind $?arrayToUse (if (eq ?myvar 0) then $?arrayA else
$?arrayB))
(call mypackage.myclass mymethod $?arrayToUse)
When I try it this way, I get a Rete exception ("method mymethod not
found or invalid argument types").
Am I using the multivariable values correctly, or is the 'if' statement
returning values of the wrong type here? After further poking around,
it seems that the $?arrayToUse variable is of type RU.MULTIFIELD. The
ReteException, however, is being thrown from within
Jess.Value.listValue(), which only accepts values of type RU.LIST.
Any thoughts on what's going wrong here?
Regards
Kenny
------------------------------------------------------
Kenny MacLeod |
| Email: [EMAIL PROTECTED]
Mutant Technology Ltd | Tel: (+44) 171 257 9988
12-13 Henrietta Street | Fax: (+44) 171 836 2600
London, UK WC2E 8LH | WWW: www.mutant-tech.com
------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------