Hi!
I have a process instance global variable containing a JPA entity. My application is a simple spring boot application using flowable-spring-boot-starter-rest.
Everything works fine until I try to retrieve the variable value with rest api (http://…/process-api/runtime/tasks//variables//data) when I get a java.io.NotSerializableException. I understand the problem and I read the note about custom serializer in https://www.flowable.org/docs/userguide/index.html#restVariables but it’s not clear to me how to do it.
I’d like to serialize the entity as json, and I tried to add this bean in my configuration, but it seems to me that it’s ignored:
@Bean
public DmnRestResponseFactory dmnRestResponseFactory() {
return new DmnRestResponseFactory() {
@Override
protected void initializeVariableConverters() {
super.initializeVariableConverters();
variableConverters.add(shipmentDataConverter());
}
};
}
Is there any example of how to register a custom serializer?
Thank you in advance for any help.
Andrea