最近在将activiti5的库升级到flowable6.4.2,以下是项目的配置,已经将flowable5CompatibilityEnabled 设置为true,配置如下:
<bean id="springProcessEngineConfiguration"
class="org.flowable.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource"></property>
<property name="databaseSchemaUpdate" value="true"></property>
<property name="flowable5CompatibilityEnabled" value="true" />
<property name="transactionManager" ref="dataSourceTransactionManager"></property>
<property name="activityFontName" value="宋体" />
<property name="labelFontName" value="宋体" />
<property name="annotationFontName" value="宋体" />
</bean>
<bean id="processEngine"
class="org.flowable.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration"
ref="springProcessEngineConfiguration">
</property>
</bean>
运行系统报如下错误:
Caused by: org.flowable.common.engine.api.FlowableException: Found v5 process definitions that are the latest version. Enable the 'flowable5CompatibilityEnabled' property in the process engine configuration and make sure the flowable5-compatibility dependency is available on the classpath
at org.flowable.engine.impl.cmd.ValidateV5EntitiesCmd.execute(ValidateV5EntitiesCmd.java:61)
at org.flowable.engine.impl.cmd.ValidateV5EntitiesCmd.execute(ValidateV5EntitiesCmd.java:32)
at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:51)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:93)
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72)
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56)
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25)
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:72)
at org.flowable.common.spring.SpringTransactionInterceptor.lambda$execute$0(SpringTransactionInterceptor.java:56)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:56)
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:35)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.postProcessEngineInitialisation(ProcessEngineConfigurationImpl.java:2494)
at org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:929)
at org.flowable.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:72)
at org.flowable.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:60)
at org.flowable.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:169)
... 55 more
查找后发现是项目未引用 flowable5CompatibilityEnabled的相关依赖,添加后问题解决。
依赖如下:
<dependency>
<groupId>org.flowable</groupId>
<artifactId>flowable5-spring-compatibility</artifactId>
<version>${flowable.version}</version>
</dependency>
相关问题:Upgraded to 6.1.0 from 5.23 version problems - #12 by anand.vivek - Flowable Engine - Flowable