JESS: Function Parameters

"Derek Adams" <[email protected]> Wed, 16 Feb 2011 14:14:37 -0600
Newsgroups gmane.comp.java.jess
Message-ID <11153_1297891103_p1GL4ZlK012727_AANLkTi=AEiUvjQgeW+CrE+N1z33b+wte3xa-Z0tccf97@mail.gmail.com>
Hello Jess-Users,

I have small jess/java issue that is causing quite a big problem.
*
(call (call ?hcu joinTo "projectStatus") eq "active" Y)*

The jess code above is performing the following:

1.  In the inner "call", it is calling the *joinTo* function on the instance
of the HibernateCritieriaUtil object, with a parameter of "projectStatus".
2.  That call returns another HibernateCritieriaUtil instance to be used in
the outer "call".
3.  The outer "call" is calling the *eq* function with 2 parameters,
"active" and Y.

The problem is coming when the function interprets Y as a string.  "active"
represents a column in the bean mapping and has a type of char.
So when it compares "active" with a string Y, it throws a
ClassCastException: type String cannot be cast to type char

Suggestions?

-- 
*Derek Adams*
Lead Developer
Arahant LLC
Work: 615-376-5500 ext. 314
Cell: 270-543-0920