Set list Variables with REST API


Hi ! I want to set a list of my workflow using the REST API in c#. So, I made this part of code :

object updateJson = new
                id = caseIdInstance +"/listTest",
                name = "listTest",
                value = newValue,
                type = "java.util.Collection"
            req = new RestRequest("API/bpm/caseVariable/" + caseIdInstance +"/"+listTest, Method.PUT);
            req.AddCookie(restCookie.Name, restCookie.Value);
            req.AddHeader("Content-Type", "application/json");
            req.RequestFormat = DataFormat.Json;
             response = ClientConnection.Execute(req);

But I have this exception :

{"exception":"class org.bonitasoft.web.toolkit.client.common.exception.api.APIException","message":"Error when updating case variable","stacktrace":"[,,
,"cause":{"exception":"class java.lang.UnsupportedOperationException","message":"Canno't create converter for class name : java.util.Collection","stacktrace":["","

I don't find the good type to put in the "type" attribute. But when I get my list with REST request, the type of my list is "java.util.Collection" !!

I hope you'll understand my problem. :)


1 answer



I have exactly the same issue when I try to update a java.util.List variable with Bonita 6.5 : java.lang.UnsupportedOperationException Canno't create converter for class name : java.util.List

Any solution is welcome

Best regards, Laurent