springboot整合flowable快速实现工作流

1 flowable-ui部署运行

从官网下载flowable-6.6.0 :

https://github.com/flowable/flowable-engine/releases/download/flowable-6.7.2/flowable-6.7.2.zip

springboot整合flowable快速实现工作流_第1张图片 将压缩包中的 flowable-6.7.2\wars\下的两个war包丢到Tomcat中的webapps文件夹中

springboot整合flowable快速实现工作流_第2张图片

 进入bin目录,启动tomcat 

cd D:\apps\apache-tomcat-8.5.75\bin 

 startup.bat命令启动tomcat

【tomcat8出现控制台乱码】

springboot整合flowable快速实现工作流_第3张图片

【解决】 

打开regedit,进入HKEY_CURRENT_USER\Console\Tomcat,如果没有Tomcat则新建。然后按照下图新建CodePage项

springboot整合flowable快速实现工作流_第4张图片

 重启tomcat,控制台出现中文,没有乱码

springboot整合flowable快速实现工作流_第5张图片

配置连接本地数据库

 进入apache-tomcat-8.5.75\webapps\flowable-ui\WEB-INF\classes\flowable-default.properties

连接本地数据库

springboot整合flowable快速实现工作流_第6张图片

把mysql驱动放在apache-tomcat-8.5.75\webapps\flowable-rest\WEB-INF\lib路径下

给apache-tomcat-8.5.75\webapps\flowable-ui\WEB-INF\lib路径下也放一个驱动

springboot整合flowable快速实现工作流_第7张图片

springboot整合flowable快速实现工作流_第8张图片再重启tomcat,成功启动

springboot整合flowable快速实现工作流_第9张图片

 访问flowable-ui本地登录页面

登录账号 admin  密码  test 

springboot整合flowable快速实现工作流_第10张图片

 登录成功后springboot整合flowable快速实现工作流_第11张图片

 点击”建模器应用程序“进行流程创建

springboot整合flowable快速实现工作流_第12张图片

 springboot整合flowable快速实现工作流_第13张图片

springboot整合flowable快速实现工作流_第14张图片

springboot整合flowable快速实现工作流_第15张图片

开始模仿着画一个流程图

springboot整合flowable快速实现工作流_第16张图片

 上图是一个完整的流程图,我们仿照着画一下

 点击圆圈,开始用户任务

springboot整合flowable快速实现工作流_第17张图片

 点击网关,到底是同意还是拒绝springboot整合flowable快速实现工作流_第18张图片

 开始或结束

springboot整合flowable快速实现工作流_第19张图片

springboot整合flowable快速实现工作流_第20张图片 把每一个节点的信息在下面定义清楚

springboot整合flowable快速实现工作流_第21张图片

画拒绝时,回到学生节点springboot整合flowable快速实现工作流_第22张图片  美化箭头springboot整合flowable快速实现工作流_第23张图片

 画出了两个拒绝节点springboot整合flowable快速实现工作流_第24张图片

 保存并下载工作流文件

 springboot整合flowable快速实现工作流_第25张图片

 这是下载的 "请假流程.bpmn20.xml"文件中的内容



  
    这是一个企业里请假的业务流程
    
    
      
        
      
    
    
      
        
      
    
    
    
      
        
      
    
    
    
    
    
    
    
    
    
    
    
  
  

    这里的代码暂时没用,先删掉
  

 把生成的xml文件放在springboot的reources下

2 springboot集成flowable

引入pom


        
            org.flowable
            flowable-spring-boot-starter
            6.7.2
        
        
        
            mysql
            mysql-connector-java
        
        
        
            com.alibaba
            druid-spring-boot-starter
            1.2.8
        
        
        
            com.baomidou
            mybatis-plus-boot-starter
            3.5.1
        
        
        
            com.github.pagehelper
            pagehelper-spring-boot-starter
            1.4.1
            
            
                
                    org.mybatis
                    mybatis
                
                
                    org.mybatis
                    mybatis-spring
                
            
        

配置application.properties

#serverPort
server.port=9001

#datasource
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/flowable_master?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.druid.initialSize=5
spring.datasource.druid.minIdle=5
spring.datasource.druid.maxActive=20
spring.datasource.druid.maxWait=60000
spring.datasource.druid.timeBetweenEvictionRunsMillis=60000
spring.datasource.druid.minEvictableIdleTimeMillis=300000
spring.datasource.druid.validationQuery=SELECT 1
spring.datasource.druid.testWhileIdle=true
spring.datasource.druid.testOnBorrow=true
spring.datasource.druid.testOnReturn=false
spring.datasource.druid.poolPreparedStatements=true
spring.datasource.druid.maxPoolPreparedStatementPerConnectionSize=20
spring.datasource.druid.filters=stat,wall
spring.datasource.druid.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
spring.datasource.druid.stat-view-servlet.allow=127.0.0.1

#mybatis-plus
mybatis-plus.global-config.db-config.id-type=auto
mybatis-plus.configuration.map-underscore-to-camel-case=true
mybatis-plus.configuration.auto-mapping-behavior=full
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.mapper-locations=classpath*:mapper/*Mapper.xml

#pageHelper
pagehelper.helper-dialect=mysql
pagehelper.reasonable=true
pagehelper.support-methods-arguments=true
pagehelper.pageSizeZero=true
pagehelper.params=count=countSql

你可能感兴趣的:(spring,boot,后端,java)