*(call (call ?hcu joinTo "projectStatus") eq "active" Y)
**(call (call ?hcu joinTo "projectStatus") eq "active" (call "Y" charAt 0))*

Above I posted the solution I found.  Apparently, Jess does not convert from
its String/Char type to the java String/Char type very well.  The function *
eq* that it was calling is overloaded to accept (String, String) and
(String, Character).  Jess just picks the first overloaded function it finds
that will work.  The (String, String) was first, so it "won".  When you
explicitly tell it what Java type to convert to, it will find the correct
version of the overloaded function to call.

If anyone has anything else to add, I'd love to hear it!

Thanks

On Wed, Feb 16, 2011 at 2:14 PM, Derek Adams <[email protected]> wrote:

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



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

Reply via email to