Spring Boot 集成 flowable 的时候,表没有自动生成

需要在连接数据库的地方添加上 &nullCatalogMeansCurrent=true,只有这样才能更新表结构

url: jdbc:mysql://127.0.0.1:3306/mlsLv?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
集成Flowable单需要以下步骤: 1. 添加Flowable单的依赖 在pom.xml文件中,添加以下依赖: ``` <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-spring-boot-starter</artifactId> <version>6.6.0</version> </dependency> <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-form-spring-boot-starter</artifactId> <version>6.6.0</version> </dependency> ``` 2. 配置Flowable 在application.yml文件中,添加以下配置: ``` flowable: database-schema-update: true history-level: full ``` 3. 创建单 创建单的方式有多种,可以使用Flowable自带的单设计器,也可以使用其他第三方单设计器。在这里,我们以Flowable自带的单设计器为例。 在Flowable Modeler中,创建一个新的模型,选择"Form"类型。然后,根据需求添加单字段,并保存单模型。 4. 部署流程 在Flowable Modeler中,创建一个新的模型,选择"BPMN"类型。然后,根据需求添加流程节点和连线,并在需要的节点上添加单。 保存流程模型后,将其导出为.bpmn20.xml格式的文件,然后将该文件放置在classpath:/processes目录下。 5. 编写代码 在Spring Boot的启动类中,添加以下代码: ``` @Configuration public class MyProcessEngineConfiguration { @Bean public ProcessEngineConfiguration processEngineConfiguration(DataSource dataSource, PlatformTransactionManager transactionManager) { SpringProcessEngineConfiguration config = new SpringProcessEngineConfiguration(); config.setDataSource(dataSource); config.setTransactionManager(transactionManager); config.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE); config.setAsyncExecutorActivate(false); config.setHistoryLevel(HistoryLevel.FULL); return config; } @Bean public ProcessEngineFactoryBean processEngine(SpringProcessEngineConfiguration configuration) { ProcessEngineFactoryBean factoryBean = new ProcessEngineFactoryBean(); factoryBean.setProcessEngineConfiguration(configuration); return factoryBean; } @Bean public RepositoryService repositoryService(ProcessEngineFactoryBean factoryBean) throws Exception { return factoryBean.getObject().getRepositoryService(); } @Bean public RuntimeService runtimeService(ProcessEngineFactoryBean factoryBean) throws Exception { return factoryBean.getObject().getRuntimeService(); } @Bean public TaskService taskService(ProcessEngineFactoryBean factoryBean) throws Exception { return factoryBean.getObject().getTaskService(); } @Bean public FormService formService(ProcessEngineFactoryBean factoryBean) throws Exception { return factoryBean.getObject().getFormService(); } @Bean public HistoryService historyService(ProcessEngineFactoryBean factoryBean) throws Exception { return factoryBean.getObject().getHistoryService(); } @Bean public ManagementService managementService(ProcessEngineFactoryBean factoryBean) throws Exception { return factoryBean.getObject().getManagementService(); } @Bean public IdentityService identityService(ProcessEngineFactoryBean factoryBean) throws Exception { return factoryBean.getObject().getIdentityService(); } @Bean public ProcessEngine processEngine(ProcessEngineFactoryBean factoryBean) throws Exception { return factoryBean.getObject(); } } ``` 这段代码的作用是创建ProcessEngine和各种服务对象,并将它们注入到Spring容器中。 然后,在需要使用单的地方,可以使用以下代码获取单: ``` FormService formService = ...; // 从Spring容器中获取FormService Object form = formService.getRenderedStartForm(processDefinitionId); // 获取流程定义的启动单 ``` 以上就是集成Flowable单的步骤。需要注意的是,由于单的渲染和提交是通过REST API实现的,因此还需要在应用程序中添加相关的REST API。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值