将 Activiti 5 BPMN 流程迁移到 Flowable 6
Migrate Activiti 5 BPMN process to Flowable 6
我正在按照 https://blog.flowable.org/2019/08/07/migration-of-a-bpmn-process/ 处的 Flowable 指南将我的 Activiti 5 流程实例迁移到 Flowable 6.5
和 https://flowable.com/open-source/docs/bpmn/ch09-ProcessInstanceMigration/#process-instance-migration-experimental
进行一些调整,因为创建 ProcessInstanceMigrationBuilder 的方法已移至 ProcessMigrationService,所以我的代码看起来像
processMigrationService
.createProcessInstanceMigrationBuilder()
.migrateToProcessDefinition(v6ProcessDefinition.getId()) // I checked it using engineVersion <> Flowable5Util.V5_ENGINE_TAG
.migrate(processInstance.getId())
org.flowable.common.engine.api.FlowableException: Flowable 5 process definitions are not supported
at org.flowable.engine.impl.dynamic.AbstractDynamicStateManager.resolveActiveExecution(AbstractDynamicStateManager.java:186) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.dynamic.AbstractDynamicStateManager.resolveMoveExecutionEntityContainers(AbstractDynamicStateManager.java:108) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.migration.ProcessInstanceMigrationManagerImpl.doMigrateProcessInstance(ProcessInstanceMigrationManagerImpl.java:425) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.migration.ProcessInstanceMigrationManagerImpl.migrateProcessInstance(ProcessInstanceMigrationManagerImpl.java:390) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.ProcessMigrationServiceImpl.migrateProcessInstance(ProcessMigrationServiceImpl.java:62) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.migration.ProcessInstanceMigrationBuilderImpl.migrate(ProcessInstanceMigrationBuilderImpl.java:138) ~[flowable-engine-6.5.0.jar:6.5.0]
但是当 Flowable 在我的 v5 bpmn 流程实例中执行一些逻辑时,我得到一个异常说“不支持 Flowable 5 流程定义”。我在这里感到困惑,Flowable提供的API的目的是将v5 bpmn流程实例迁移到v6,当我运行它时,它说不支持我的流程定义。
迁移的目的API是支持在 Flowable 6 流程实例的不同流程定义版本之间迁移。
不支持将流程实例从 Activiti / Flowable 5 迁移到 Flowable 6,因为它们具有不同的结构。兼容层在那里,所以你可以保持 运行 旧的 Flowable 5 进程实例与 Flowable 6 进程实例并行。
我正在按照 https://blog.flowable.org/2019/08/07/migration-of-a-bpmn-process/ 处的 Flowable 指南将我的 Activiti 5 流程实例迁移到 Flowable 6.5 和 https://flowable.com/open-source/docs/bpmn/ch09-ProcessInstanceMigration/#process-instance-migration-experimental
进行一些调整,因为创建 ProcessInstanceMigrationBuilder 的方法已移至 ProcessMigrationService,所以我的代码看起来像
processMigrationService
.createProcessInstanceMigrationBuilder()
.migrateToProcessDefinition(v6ProcessDefinition.getId()) // I checked it using engineVersion <> Flowable5Util.V5_ENGINE_TAG
.migrate(processInstance.getId())
org.flowable.common.engine.api.FlowableException: Flowable 5 process definitions are not supported
at org.flowable.engine.impl.dynamic.AbstractDynamicStateManager.resolveActiveExecution(AbstractDynamicStateManager.java:186) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.dynamic.AbstractDynamicStateManager.resolveMoveExecutionEntityContainers(AbstractDynamicStateManager.java:108) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.migration.ProcessInstanceMigrationManagerImpl.doMigrateProcessInstance(ProcessInstanceMigrationManagerImpl.java:425) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.migration.ProcessInstanceMigrationManagerImpl.migrateProcessInstance(ProcessInstanceMigrationManagerImpl.java:390) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.ProcessMigrationServiceImpl.migrateProcessInstance(ProcessMigrationServiceImpl.java:62) ~[flowable-engine-6.5.0.jar:6.5.0]
at org.flowable.engine.impl.migration.ProcessInstanceMigrationBuilderImpl.migrate(ProcessInstanceMigrationBuilderImpl.java:138) ~[flowable-engine-6.5.0.jar:6.5.0]
但是当 Flowable 在我的 v5 bpmn 流程实例中执行一些逻辑时,我得到一个异常说“不支持 Flowable 5 流程定义”。我在这里感到困惑,Flowable提供的API的目的是将v5 bpmn流程实例迁移到v6,当我运行它时,它说不支持我的流程定义。
迁移的目的API是支持在 Flowable 6 流程实例的不同流程定义版本之间迁移。
不支持将流程实例从 Activiti / Flowable 5 迁移到 Flowable 6,因为它们具有不同的结构。兼容层在那里,所以你可以保持 运行 旧的 Flowable 5 进程实例与 Flowable 6 进程实例并行。