当前位置: 首页 > news >正文

wordpress 关键词链接搜狗seo刷排名软件

wordpress 关键词链接,搜狗seo刷排名软件,南京网站制作报价,网站建设专业的公司哪家好​ 博客主页: 南来_北往 系列专栏:Spring Boot实战 在现代企业应用中,工作流管理是一个至关重要的部分。通过使用Spring Boot和Flowable,可以方便地构建和管理工作流。本文将详细介绍如何在Spring Boot项目中集成Flowable UI&#xff0c…

 ​

博客主页:     南来_北往

系列专栏:Spring Boot实战


在现代企业应用中,工作流管理是一个至关重要的部分。通过使用Spring Boot和Flowable,可以方便地构建和管理工作流。本文将详细介绍如何在Spring Boot项目中集成Flowable UI,并实现一个简单的请假流程。

1. 环境准备
  • JDK版本:1.8
  • Maven版本:3.x
  • Spring Boot版本:2.7.5
  • Flowable版本:6.6.0
  • 数据库:MySQL 8.0
2. 创建Spring Boot项目

首先,使用Spring Initializr或任何你喜欢的IDE(如IntelliJ IDEA或Eclipse)创建一个新的Spring Boot项目。

3. 添加依赖

pom.xml文件中添加以下依赖:

<properties>  <maven.compiler.source>8</maven.compiler.source>  <maven.compiler.target>8</maven.compiler.target>  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  <flowable.version>6.6.0</flowable.version>  
</properties>  <parent>  <groupId>org.springframework.boot</groupId>  <artifactId>spring-boot-starter-parent</artifactId>  <version>2.7.5</version>  
</parent>  <dependencies>  <dependency>  <groupId>org.springframework.boot</groupId>  <artifactId>spring-boot-starter-web</artifactId>  </dependency>  <dependency>  <groupId>org.flowable</groupId>  <artifactId>flowable-spring-boot-starter</artifactId>  <version>${flowable.version}</version>  </dependency>  <dependency>  <groupId>org.flowable</groupId>  <artifactId>flowable-spring-boot-starter-ui-idm</artifactId>  <version>${flowable.version}</version>  </dependency>  <dependency>  <groupId>org.flowable</groupId>  <artifactId>flowable-spring-boot-starter-ui-modeler</artifactId>  <version>${flowable.version}</version>  </dependency>  <dependency>  <groupId>mysql</groupId>  <artifactId>mysql-connector-java</artifactId>  <version>8.0.31</version>  </dependency>  <dependency>  <groupId>org.mybatis.spring.boot</groupId>  <artifactId>mybatis-spring-boot-starter</artifactId>  <version>2.2.2</version>  </dependency>  <dependency>  <groupId>org.projectlombok</groupId>  <artifactId>lombok</artifactId>  </dependency>  <dependency>  <groupId>org.springframework.boot</groupId>  <artifactId>spring-boot-starter-test</artifactId>  <scope>test</scope>  </dependency>  
</dependencies>
4. 配置数据库连接

application.properties文件中配置数据库连接信息:

# 端口  
server.port=8081  # UI相关信息  
flowable.idm.app.admin.user-id=admin  
flowable.idm.app.admin.password=admin  
flowable.idm.app.admin.first-name=xxx  
flowable.idm.app.admin.last-name=xxx  
flowable.database-schema-update=true  # 关闭定时任务JOB  
flowable.async-executor-activate=false  # 数据库  
spring.datasource.url=jdbc:mysql://localhost:3306/flowable-test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true  
spring.datasource.username=root  
spring.datasource.password=123456  
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver  
spring.datasource.type=com.zaxxer.hikari.HikariDataSource  # 日志  
logging.level.org.flowable=DEBUG

确保在MySQL中创建一个名为flowable-test的数据库,Flowable会在启动时自动创建所需的表。

5. 配置Flowable UI

Flowable UI是一个用于设计和管理工作流的Web应用。在Spring Boot项目中集成Flowable UI需要添加相应的依赖并配置相应的资源。

确保你的pom.xml中已经包含了Flowable UI的依赖:

<dependency>  <groupId>org.flowable</groupId>  <artifactId>flowable-spring-boot-starter-ui-idm</artifactId>  <version>${flowable.version}</version>  
</dependency>  
<dependency>  <groupId>org.flowable</groupId>  <artifactId>flowable-spring-boot-starter-ui-modeler</artifactId>  <version>${flowable.version}</version>  
</dependency>

然后,在Spring Boot应用的resources目录下创建META-INF文件夹,并复制flowable-default.properties文件到该文件夹中。这个文件用于配置Flowable UI的默认设置。

6. 设计请假流程
  1. 启动Spring Boot应用。
  2. 访问Flowable UI的Modeler页面(通常是http://localhost:8081/flowable-modeler)。
  3. 在Modeler中创建一个新的流程模型,并设计请假流程。例如,你可以添加“申请请假”、“组长审批”、“经理审批”等节点。
  4. 保存并发布流程模型。
7. 实现请假流程的控制逻辑

在Spring Boot项目中实现请假流程的控制逻辑,包括启动流程、查询任务、审批任务等。

import org.flowable.engine.RuntimeService;  
import org.flowable.engine.TaskService;  
import org.flowable.engine.runtime.ProcessInstance;  
import org.flowable.task.api.Task;  
import org.springframework.beans.factory.annotation.Autowired;  
import org.springframework.web.bind.annotation.*;  import java.util.HashMap;  
import java.util.List;  
import java.util.Map;  @RestController  
@RequestMapping("/leave")  
public class LeaveController {  @Autowired  private RuntimeService runtimeService;  @Autowired  private TaskService taskService;  // 发起请假流程  @PostMapping("/apply")  public String applyLeave(@RequestParam String userId, @RequestParam int days, @RequestParam String description) {  Map<String, Object> variables = new HashMap<>();  variables.put("userId", userId);  variables.put("days", days);  variables.put("description", description);  ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("leaveProcess", variables);  return "流程启动成功,流程ID:" + processInstance.getId();  }  // 查询待办任务  @GetMapping("/my-tasks")  public List<Task> getMyTasks(@RequestParam String userId) {  return taskService.createTaskQuery().taskAssignee(userId).list();  }  // 审批任务  @PostMapping("/approve")  public String approveTask(@RequestParam String taskId, @RequestParam String outcome) {  taskService.complete(taskId, Collections.singletonMap("outcome", outcome));  return "任务审批成功";  }  
}
8. 启动应用并测试

启动Spring Boot应用,并访问Flowable UI页面进行流程设计和管理。然后,通过API接口或Postman等工具测试请假流程的控制逻辑。

至此,你已经成功地在Spring Boot项目中集成了Flowable UI,并实现了一个简单的请假流程。你可以根据实际需求进一步扩展和优化这个流程。

http://www.dinnco.com/news/79666.html

相关文章:

  • 网站年费怎么做分录推广网站seo
  • 什么网站能买建设摩托车带佣金的旅游推广平台有哪些
  • 设计之家下载正规seo需要多少钱
  • 阿里云建站和华为云建站哪个好优化外包哪里好
  • 服装公司网站定位手机百度快照
  • 网页设计课程心得体会500字网站关键词优化建议
  • 给女朋友做网站的素材百度手机助手app下载并安装
  • 网站开发详细报价单seo论坛站长交流
  • 福州网签南宁市优化网站公司
  • 怎么建设自己网站百度手机怎么刷排名多少钱
  • the7 wordpress theme百度推广seo
  • 南宁做网站优化的公司南京百度搜索优化
  • 七星彩投注网站怎么做哪家公司做seo
  • 推荐一些可以做笔试题的网站独立站seo推广
  • 制作网站软件作品厦门人才网最新招聘信息网
  • 女人做春梦网站天津网站快速排名提升
  • 中小微企业税收政策优化的意思
  • 卖童书的网站该怎么做网站优化设计的基础是网站基本要素及每个细节的优化
  • wordpress分类目录名称上海优化公司有哪些
  • 南宁网站优化公司电话自己怎么优化网站
  • 月嫂网站建设方案外链怎么做
  • 建设企业网站就等于开展网络营销app怎么推广运营
  • 动态网站j建设实训报告热点新闻事件今日最新
  • wordpress列类型长清区seo网络优化软件
  • 网站建设套餐服务bing搜索引擎国内版
  • 网络规划设计师教程第三版云盘下载工具站seo
  • 与企业网站做接口什么是优化
  • 网站顶部公告代码seo是什么岗位的缩写
  • 建站之星凡客网络营销七个步骤
  • 网上共青团智慧团建网址关键词seo价格