flowable6.7.2工作流升级fastjson2
时间: 2023-10-24 18:09:47 浏览: 45
升级 Flowable 6.7.2 工作流时,需要将 Fastjson 2.x 版本集成到项目中。具体步骤如下:
1. 在项目的 pom.xml 文件中,添加 Fastjson 2.x 版本的依赖:
```
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.62</version>
</dependency>
```
2. 在项目的 Spring 配置文件中,将 Fastjson 2.x 配置为 Flowable 的 JSON 引擎,例如:
```
<bean id="processEngineConfiguration" class="org.flowable.spring.SpringProcessEngineConfiguration">
...
<property name="jsonEngine">
<bean class="org.flowable.variable.service.impl.types.JSONObjectType">
<constructor-arg>
<bean class="com.alibaba.fastjson.JSON">
<factory-method>getFastJsonConfig</factory-method>
</bean>
</constructor-arg>
</bean>
</property>
...
</bean>
```
3. 如果使用了 REST API,需要更新 REST API 的配置文件,例如:
```
<bean id="restResponseFactory" class="org.flowable.rest.service.api.RestResponseFactory">
<property name="objectMapper">
<bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>application/json</value>
</list>
</property>
<property name="fastJsonConfig">
<bean class="com.alibaba.fastjson.support.config.FastJsonConfig">
<property name="serializerFeatures">
<array>
<value>WriteDateUseDateFormat</value>
<value>WriteNullStringAsEmpty</value>
<value>WriteNullListAsEmpty</value>
<value>DisableCircularReferenceDetect</value>
</array>
</property>
</bean>
</property>
</bean>
</property>
</bean>
```
完成以上步骤后,Fastjson 2.x 就成功集成到了 Flowable 6.7.2 工作流项目中。