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;
req.AddBody(updateJson);
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":"[org.bonitasoft.web.rest.server.datastore.bpm.cases.CaseVariableDatastore.updateVariableValue(CaseVariableDatastore.java:82), org.bonitasoft.web.rest.server.api.bpm.cases.APICaseVariable.runUpdate(APICaseVariable.java:40), org.bonitasoft.web.rest.server.api.bpm.cases.APICaseVariable.runUpdate(APICaseVariable.java:30)
......
java.lang.Thread.run(Thread.java:744)]","cause":{"exception":"class java.lang.UnsupportedOperationException","message":"Canno't create converter for class name : java.util.Collection","stacktrace":["org.bonitasoft.web.rest.server.framework.utils.converter.ConverterFactory.createConverter(ConverterFactory.java:48)","org.bonitasoft.web.rest.server.framework.utils.converter.TypeConverter.convert
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.
Cheers.