flowable支持的jdk版本_Flowable基础二十一 Flowable springboot 集成

Spring Boot

Spring Boot是一个应用框架,按照官网的介绍,可以轻松地创建独立运行的,生产级别的,基于Spring的应用,并且可以“直接运行”。坚持使用Spring框架与第三方库,使你可以轻松地开始使用。大多数Spring Boot应用只需要很少的Spring配置。

Flowable与Spring Boot的集成目前是我们与Spring的提交者共同开发的。

1.1. 兼容性 Compatibility

Spring Boot需要JDK 7运行时环境。可以通过调整配置,在JDK6下运行。请查阅Spring Boot的文档。

1.2. 开始 Getting started

Spring Boot提倡约定大于配置。要开始工作,简单地在你的项目中添加spring-boot-starters-basic依赖。例如在Maven中:

org.flowable

flowable-spring-boot-starter-basic

${flowable.version}

就这么简单。这个依赖会自动向classpath添加正确的Flowable与Spring依赖。现在你可以编写Spring Boot应用了:

import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;

import org.springframework.context.annotation.ComponentScan;

import org.springframework.context.annotation.Configuration;

@

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
集成 Flowable 可以让 Spring Boot 应用程序具有工作流功能。下面是在 Spring Boot 中集成 Flowable 的步骤: 1. 添加依赖。在 pom.xml 文件中添加以下依赖: ``` <dependency> <groupId>org.flowable</groupId> <artifactId>flowable-spring-boot-starter</artifactId> <version>6.5.0</version> </dependency> ``` 2. 配置数据源。在 application.properties 文件中添加以下配置: ``` spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/flowable?useUnicode=true&characterEncoding=utf-8 spring.datasource.username=root spring.datasource.password=root ``` 3. 创建流程定义。在 resources 目录下创建一个名为 processes 的目录,然后在该目录下创建一个名为 myprocess.bpmn20.xml 的文件,该文件包含要创建的流程定义。 4. 创建 Service。创建一个名为 MyService 的类,并在该类中添加以下代码: ``` @Service public class MyService { @Autowired private RuntimeService runtimeService; public void startProcess(String processDefinitionKey) { runtimeService.startProcessInstanceByKey(processDefinitionKey); } } ``` 5. 创建 Controller。创建一个名为 MyController 的类,并在该类中添加以下代码: ``` @RestController @RequestMapping("/my") public class MyController { @Autowired private MyService myService; @PostMapping("/start-process") public void startProcess(@RequestParam("processDefinitionKey") String processDefinitionKey) { myService.startProcess(processDefinitionKey); } } ``` 6. 启动应用程序。运行 Spring Boot 应用程序。 现在,您已经成功在 Spring Boot 中集成Flowable,并可以使用工作流功能。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值