Custom serializer configuration


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 I understand the problem and I read the note about custom serializer in 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:

public DmnRestResponseFactory dmnRestResponseFactory() {
    return new DmnRestResponseFactory() {
        protected void initializeVariableConverters() {

Is there any example of how to register a custom serializer?

Thank you in advance for any help.


1 Like

Hey Andrea,

I would presume that you are using the Spring Boot auto-configuration from Flowable. It seems that currently you can’t override the DmnRestReponseFactory bean. The reason why your bean is not picked up is that the Rest Servlet is registered in a child context via the DmnEngineRestConfiguration in the RestApiAutoConfiguration.DmnEngineRestApiConfiguration.

If you want you can create a PR that would allow you to add custom converters to the DmnRestResponseFactory.