flowable / flowable-engine

A compact and highly efficient workflow and Business Process Management (BPM) platform for developers, system admins and business users.
https://www.flowable.org
Apache License 2.0
8.01k stars 2.63k forks source link

Flowable mybatis typehandler maybe not work correctly on the json column type #3930

Closed NotFound403 closed 4 months ago

NotFound403 commented 4 months ago

Describe the bug Flowable mybatis cause diff mechanism, the same mapper return the diff resultset between flowable and unit test.

in mysql 8,the numberic value in json column is converted to string by flowable,

Expected behavior keep the same mechanism

Code

this is a service to get a json column in mysql 8,it return to string.

String formData = formDataInfoService.getFormData("1815276433849917442");

in junit test, it worked correctly, formData: ···json {"num":1,"buyer":"tom","amount":550000,"orderNo":"k1213213","category":"S300","_date_picker_6":"2024-07-10"} ··· when i use the service in a flowable AbstractVariableComparatorExpressionFunction implemention

private static boolean compareVariableValues(VariableContainer variableContainer, String variableName, Object comparedValue, OPERATOR operator) {
        Object variableValue = variableContainer.getVariable(variableName);
        if (variableValue == null) {
            ExecutionEntity executionEntity = (ExecutionEntity) variableContainer;
            String processInstanceId = executionEntity.getProcessInstanceId();
            IFlwFormDataInfoService formDataInfoService = SpringContext.getBean(IFlwFormDataInfoService.class);
            String formData = formDataInfoService.getFormData(processInstanceId);

//  ignore 
  } 
}

here the formData wrongly:

{"num":"1","buyer":"tom","amount":"550000","orderNo":"k1213213","category":"S300","_date_picker_6":"2024-07-10"}

the num and the amount is string now

Additional context Add the version of Flowable that you are using, the database vendor and if you are using Flowable within Spring Boot, the Flowable Task application etc.