使用 Flowable(6.6.)时,出现异常:org.flowable.ui.common.service.exception.ConflictingRequestException: Process model was updated in the meantime
经过代码跟踪,发现是这里有问题:
org.flowable.ui.modeler.rest.app.ModelResource.saveModel(ModelResource.java):
通过idea 跟踪调试可以发现应该相等的这两个值不相等, model.getLastUpdated().getTime()的结果是毫秒级别,而lastUpdated的值是秒级。
别的文章一般建议注释掉配置文件里的jackson时间格式设置,这里的设置导致 lastUpdated的精度和 model.getLastUpdated().getTime()不一致:
## json时间格式设置
#spring.jackson.time-zone=GMT+8
#spring.jackson.date-format=yyyy/MM/dd HH:mm:ss
我们这里给时间格式精确到毫秒即可,从而防止影响项目的其他功能:
## json时间格式设置
spring.jackson.time-zone=GMT+8
spring.jackson.date-format=yyyy/MM/dd HH:mm:ss.SSS
调整完成后,Exception 消失。