The method "orderList" wants a java.util.List. You're passing it a
Jess list, an RU.LIST, which is an instance of
jess.ValueVector. They're not equivalent. In general, Jess converts
RU.LISTs to arrays when calling Java methods; Jess has no special
syntax or considerations for dealing with java.util.List. You have to
create and populate the List explicitly, just as you would in Java:

(bind ?a (new java.util.ArrayList))
(?a add (new Code.ResultClassArticle "karine" 8 7 2 1 1))
(?a add (new Code.ResultClassArticle "Fab_ola" 4 1 5 1 1)))

I think Eunice Palmeira wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hello,
>      I have a problem with LIST using Java and Jess. In Java i have the
> method in the class 'Order' as follow:
> 
> public static List orderList(List list, String str) {
> ...
> }
> 
> When i call 'orderList' in Java, i write:
> 
>  Object[] RClist = { new ResultClass("karine", 8, 7, 2, 1, 1),
>             new ResultClass("Fab_ola", 4, 1, 5, 1, 1)};
>  List list = Arrays.asList(RClist);
>  list = Order.orderList(list, "str1");
> 
> In Jess when i call 'orderList', i write:
> 
> (bind $?a (create$ (new Code.ResultClassArticle "karine" 8 7 2 1 1) (new
> Code.ResultClassArticle "Fab_ola" 4 1 5 1 1)))
> (call Code.Order orderList $?a "str1")
> 
> Then,
> 
> Jess reported an error in routine call
>  while executing (call Code.Order orderList $?a "str1").
>   Message: No overloading of method 'orderList' in class Code.Order I can
> call with these arguments: (call Code.Order orderList (<External-Address:
> Code.ResultClassArticle> <External-Address:Code.ResultClassArticle>)
> "str1").
>   ....
> 
> My question is: How can i do to transfer list from Jess to Java?
>    Thanks,
>          Eunice Palmeira



---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (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]
--------------------------------------------------------------------

Reply via email to