flowable-engine icon indicating copy to clipboard operation
flowable-engine copied to clipboard

REST API responses with null value for UUID variable types

Open pvojtechovsky opened this issue 1 year ago • 1 comments

Describe the bug The REST API method flowable-rest/service/query/historic-variable-instances returns null as value of variable of type uuid

        {
            "id": "85077ed6-d62c-11ee-ae20-86c5a61b31b3",
            "processInstanceId": "827254fd-d62c-11ee-ae20-86c5a61b31b3",
            "processInstanceUrl": "http://test-server/flowable-rest/service/history/historic-process-instances/827254fd-d62c-11ee-ae20-86c5a61b31b3",
            "taskId": null,
            "executionId": "827254fd-d62c-11ee-ae20-86c5a61b31b3",
            "variable": {
                "name": "animalId",
                "type": "uuid",
                "value": null,  //<-------- here is unexpected null
                "scope": "global"
            }
        },

Expected behavior The UUID variable value should be serialized as string like

"value": "201d919d-9974-4813-8628-ae815f311678",

Code /flowable-rest/src/main/java/org/flowable/rest/service/api/RestResponseFactory.java method createRestVariable is searching for a convertor list of variableConverters. But there is no variable converter for variable type org.flowable.variable.service.impl.types.UUIDType so the createRestVariable returns a RestVariable with null value.

Additional context Problem was reproduced on Flowable 6.8.0, but I checked the sources and it exists on main branch too.

Would be nice to have a fix in next 7.0.x release as we are going to upgrade to that version soon.

I am going to provide a Pull request for the fix soon.

pvojtechovsky avatar Mar 04 '24 14:03 pvojtechovsky

@tijsrademakers Can you take a look at our PR and if you agree merge it before the next Flowable release please?

tomsvet avatar Jul 02 '24 11:07 tomsvet