Serialization is not working

Hi,

i do have a simple workflow of a number of user tasks where one of them trigger a message with some variables.
the user task initialise an object and set it in a variable called TaskResult. the variable can be viewed in the cockpit serialised correctly and it is type is identified as java object. but when i run script (listener script on task complete) with the following code

var execution=task.execution;
execution
.getProcessEngineServices()
.getRuntimeService()
.createMessageCorrelation(“EmailMessageEvent”)
.setVariable(“TaskResult”,TaskResult).correlateWithResult();

the variable get serialised as a hashmap which totally unusable in my app (using C# /Rest API)
does anyone know how to fix this .

Regards,

Camunda serializes your object in a java context.
Your C# application does not have access to the classpath.
You need to create an equivalent class in your C# API and convert the HashMap you are getting into an instance of the object.

Hope this helps. Cheers!