[web教学] 若依(RuoYi-Vue)+Flowable工作流前后端整合教程

[复制链接]
查看1743 | 回复3 | 2023-8-23 12:10:09 | 显示全部楼层 |阅读模式 来自 中国北京
此教程得当若依前后端分离项目,其他项目可以在扩展列表中举行查找。
近期公司里必要对很久以前的RuoYi-Vue前后端分离项目扩展出flowable的功能,当然这个重任也是落在了我的身上(否则也不会有这篇文章),然后我在官网看到了RuoYi-Vue-Flowable这个项目,按照文档提供的迁徙方式对于我们这个老版本的项目来说无法正常运行,以是我联系了作者并更新了一下文档,计划在网上在发布一篇(毕竟有的人懒得看官方文档)。
官方项目地址:https://gitee.com/tony2y/RuoYi-flowable
把项目拉到本地后下面开始整合教程,整合教程分为前端和后端两个模块。
前端迁徙流程

1.flowale功能页面干系内容迁徙

1.1 把目次ruoyi-ui/src/views/下的flowable文件夹移动到你自己前端项目中的/src/views/文件下。

1.2 移动页面配套的js文件,将ruoyi-ui/src/api/下的flowable文件夹移动到自己项目中的/src/api/文件下。

2.flowale流程计划器干系内容迁徙

ruoyi-ui/src/components目次下的customBpmn,flow,parser,Process,render,tinymce文件夹移动到自己项目中的/src/components文件下。

3.表单计划器与职员选择模块干系文件迁徙

3.1ruoyi-ui/src/views/tool中的build文件夹移动到自己项目中的/src/views/tool文件下,存在则覆盖。

3.2 迁徙表单计划器干系样式,将ruoyi-ui/src下的styles文件移动到自己项目中的/src文件夹下。

3.3 修改ruoyi-ui/src/utils/index.js中的deepClone函数。

修改为如下内容,存在该函数做修改,不存在做新增。
  
  1. // 深拷贝对象
  2. export function deepClone(obj) {
  3.   const _toString = Object.prototype.toString
  4.   // null, undefined, non-object, function
  5.   if (!obj || typeof obj !== 'object') {
  6.     return obj
  7.   }
  8.   // DOM Node
  9.   if (obj.nodeType && 'cloneNode' in obj) {
  10.     return obj.cloneNode(true)
  11.   }
  12.   // Date
  13.   if (_toString.call(obj) === '[object Date]') {
  14.     return new Date(obj.getTime())
  15.   }
  16.   // RegExp
  17.   if (_toString.call(obj) === '[object RegExp]') {
  18.     const flags = []
  19.     if (obj.global) { flags.push('g') }
  20.     if (obj.multiline) { flags.push('m') }
  21.     if (obj.ignoreCase) { flags.push('i') }
  22.     return new RegExp(obj.source, flags.join(''))
  23.   }
  24.   const result = Array.isArray(obj) ? [] : obj.constructor ? new obj.constructor() : {}
  25.   for (const key in obj) {
  26.     result[key] = deepClone(obj[key])
  27.   }
  28.   return result
  29. }
复制代码
3.4 迁徙或更换干系js文件,存在则更换,不存在则新增,将ruoyi-ui/src/utils/generatorruoyi-ui/src/utils文件夹中对应下图红框的js文件移动到自己项目中对应的文件夹中。

3.5 迁徙表单计划器干系图标,将ruoyi-ui/src下的icons文件移动到自己项目中的/src文件夹下。​

4. 流程表达式、流程监听器干系内容迁徙

4.1 干系页面迁徙,将ruoyi-ui/src/views/system下的expression,listener文件夹移动到自己项目中的/src/views/system文件夹下。

4.2 干系js文件迁徙,将ruoyi-ui/src/api/system下的expression.js,listener.js文件移动到自己项目中的/src/api/system文件夹下。

5. main.js中引入组件


main.js中连合上图添加如下代码。
  1. import Tinymce from '@/components/tinymce/index.vue'
  2.   
  3. Vue.component('tinymce', Tinymce)
复制代码
6. package.json中新增依赖


package.json中连合上图添加如下依赖。
  1. "bpmn-js": "^11.1.0",
  2. "diagram-js": "^11.4.1",
  3. "xcrud": "^0.4.19",
  4. "vkbeautify": "^0.99.3",
复制代码
7. 新增路由配置

ruoyi-ui/src/router/index.js文件中添加路由配置,差异的ruoyi版本路由写法不同等,请参照自己项目路由举行添加。
参考如下:
  1.   {
  2.     path: '/flowable',
  3.     component: Layout,
  4.     hidden: true,
  5.     children: [
  6.       {
  7.         path: 'definition/model/',
  8.         component: () => import('@/views/flowable/definition/model'),
  9.         name: 'Model',
  10.         meta: { title: '流程设计', icon: '' }
  11.       }
  12.     ]
  13.   },
  14.   {
  15.     path: '/flowable',
  16.     component: Layout,
  17.     hidden: true,
  18.     children: [
  19.       {
  20.         path: 'task/finished/detail/index',
  21.         component: () => import('@/views/flowable/task/finished/detail/index'),
  22.         name: 'FinishedRecord',
  23.         meta: { title: '流程详情', icon: '' }
  24.       }
  25.     ]
  26.   },
  27.   {
  28.     path: '/flowable',
  29.     component: Layout,
  30.     hidden: true,
  31.     children: [
  32.       {
  33.         path: 'task/myProcess/detail/index',
  34.         component: () => import('@/views/flowable/task/myProcess/detail/index'),
  35.         name: 'MyProcessRecord',
  36.         meta: { title: '流程详情', icon: '' }
  37.       }
  38.     ]
  39.   },
  40.   {
  41.     path: '/flowable',
  42.     component: Layout,
  43.     hidden: true,
  44.     children: [
  45.       {
  46.         path: 'task/myProcess/send/index',
  47.         component: () => import('@/views/flowable/task/myProcess/send/index'),
  48.         name: 'SendRecord',
  49.         meta: { title: '流程发起', icon: '' }
  50.       }
  51.     ]
  52.   },
  53.   {
  54.     path: '/flowable',
  55.     component: Layout,
  56.     hidden: true,
  57.     children: [
  58.       {
  59.         path: 'task/todo/detail/index',
  60.         component: () => import('@/views/flowable/task/todo/detail/index'),
  61.         name: 'TodoRecord',
  62.         meta: { title: '流程处理', icon: '' }
  63.       }
  64.     ]
  65.   },
  66.   {
  67.     path: '/tool',
  68.     component: Layout,
  69.     hidden: true,
  70.     children: [
  71.       {
  72.         path: 'build/index',
  73.         component: () => import('@/views/tool/build/index'),
  74.         name: 'FormBuild',
  75.         meta: { title: '表单配置', icon: '' }
  76.       }
  77.     ]
  78.   }
复制代码
8. 启动项目

删除node_modules文件夹,控制台实行npm install下载完毕后启动项目即可。
由于参加了流程校验器,迁徙项目后启动错误请实行以下下令
  1. npm install create-bpmnlint-plugin -D
复制代码
后端迁徙流程

1. 在父级pom文件中参加如下依赖

  1. <!-- properties -->
  2. <properties>
  3.   <flowable.version>6.7.2</flowable.version>
  4. </properties>
  5. <!-- dependency -->
  6. <dependency>
  7.   <groupId>com.ruoyi</groupId>
  8.   <artifactId>ruoyi-flowable</artifactId>
  9.   <version>${ruoyi.version}</version>
  10. </dependency>
  11. <dependency>
  12.   <groupId>io.swagger</groupId>
  13.   <artifactId>swagger-annotations</artifactId>
  14.   <version>1.5.21</version>
  15.   <scope>compile</scope>
  16. </dependency>
  17. <dependency>
  18.     <groupId>org.flowable</groupId>
  19.     <artifactId>flowable-spring-boot-starter</artifactId>
  20.     <version>${flowable.version}</version>
  21. </dependency>
  22. <dependency>
  23.   <groupId>com.baomidou</groupId>
  24.   <artifactId>mybatis-plus-boot-starter</artifactId>
  25.   <version>3.4.0</version>
  26. </dependency>
  27. <!--el表达式计算-->
  28. <dependency>
  29.   <groupId>com.googlecode.aviator</groupId>
  30.   <artifactId>aviator</artifactId>
  31.   <version>5.3.3</version>
  32. </dependency>
  33. <!--modules -->
  34. <modules>
  35.     <module>ruoyi-flowable</module>
  36. </modules>
复制代码

2. 把RuoYi-flowable项目中的ruoyi-flowable文件夹整个迁徙到自己项目中


3. 在admin项目标pom文件中引入ruoyi-flowable项目

  1. <dependency>
  2.     <groupId>com.ruoyi</groupId>
  3.     <artifactId>ruoyi-flowable</artifactId>
  4. </dependency>
复制代码
4. 迁徙flowable干系类

根据若依项目标版本差异,缺少的实体类,mapper,service也会有所差异,以是必要根据flowable项目中所提示缺少的类举行针对性的拷贝,假如为service接口记得补全对应的controller。
5. 在admin项目标yml配置文件中新增如下配置

application.yml文件中添加如下配置
  1. # flowable相关表
  2. flowable:
  3.   # true 会对数据库中所有表进行更新操作。如果表不存在,则自动创建(建议开发时使用)
  4.   database-schema-update: false
  5.   # 关闭定时任务JOB
  6.   async-executor-activate: false
复制代码
数据源地址后必要加上nullCatalogMeansCurrent=true,包管自动创建flowable表时不会报错。
6. 迁徙数据库表

新建一个库实行tony-flowable.sql文件,flowable项目中少什么表就将对应的表导入到自己的数据库中,mysql数据库版本要用5.7。

7. 数据迁徙

sys_menu对应下图红框中的菜单数据参加到自己的表中。

 将sys_dict_type对应下图红框中的字典类型数据添加到自己的表中。

 将sys_dict_data对应下图红框中的字典数据添加到自己的表中。

8. 启动项目

第一次启动时必要把yml配置文件中的database-schema-update设置为true,如许会自动创建flowable中所必要的全部表。
完成上述操作后就可以在自己项目中正常利用了。 


来源:https://blog.csdn.net/TangBoBoa/article/details/129481865
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
回复

使用道具 举报

FrankJScott | 前天 20:52 | 显示全部楼层 来自 英国

Recommended Tajir4D Link Alternatif Website

In response to the people talking about aplikasi judi online terpercaya, situs toto online terpercaya, bandar togel dan slot terpercaya, slot judi terbaru, permainan togel slot, situs 4d, semua situs slot online, menang judi togel, agen slot paling mudah menang, judi slot uang asli,  I highly recommend this that guy on login tajir4d info or slot mudah menang, nama situs togel online, situs agen slot online, agen togel live 4d, situs mudah menang, situs slot online resmi, game judi online slot, murni slot, live casino idn, slot yang, together with this great tajir4d link alternatif site together with tajir4d slot, daftar agen togel resmi, judi slot tembak ikan, menang casino, game slot asli, situs judi toto, slot lewat pulsa, slot pragmatik play, judi togel online terpercaya, 100 slot, together with this source for login tajir4d link which is also great. Also, have a look at this useful login tajir4d advice as well as situs slot terpercaya, slot online deposit, game terbaru saat ini, permainan judi togel, slot wap, agen toto slot, game judi slot online, web judi slot, situs pragmatic play asli, casino togel, not forgetting sites such as this get more info about tajir4d link alternatif link as well as situs togel online terpercaya di indonesia, slot via, slot casino indonesia, situs web slot, situs slot,  i was reading this on not to mention bandar judi terbesar di indonesia, slot yang terbaru, situs slot pragmatic play, play togel, situs togel promo,  for good measure. Check more @ Useful Tajir4D Link Alternatif Site b3fd98c
回复

使用道具 举报

FrankJScott | 昨天 01:45 | 显示全部楼层 来自 英国

Great Laser Facial Skin Tightening Guide

For the guy asking about laser skin resurfacing treatments, best non invasive treatment for skin tightening, med spa, skin tightening non invasive, best rf microneedling, best skin treatment, dermal fillers for, lift facial aesthetics, p injections, rejuvenation treatment for skin,  I highly suggest this additional info about laser treatment results forum or facial and chemical peel, prp filler injections, we aesthetics, led red light therapy for face, the perfect derma chemical peel, laser treatment for, skin lifting facial, non surgical skin tightening, rf body treatment, lip filler why, and don't forget this top rated pigmentation treatment Sarasota tips on top of best cosmetic fillers for face, laser skin, laser treatment cellulite, renuva injections, skin reduction, best non surgical hair restoration, wrinkle fillers, best tightening skin treatment, best face fillers, platelet rich plasma therapy facial, alongside all this recommended you read for laser treatment Sarasota forum which is also great. Also, have a look at this your input here for pigmentation treatment Sarasota tips bearing in mind led red light skin therapy, non surgical skin tightening, face rejuvenation treatments, face tightening procedures, facial laser skin resurfacing, cool peel co2 laser, pdo thread breast lift, skin texture laser treatment, best facial sarasota, regenerative aesthetics, not to mention this resources for laser medspa Sarasota url which is worth considering with best med spa treatments, best laser for face tightening, microneedling skin treatment, lip filler and lip injections, derm facial,  agree with on as well as facial and body, skin lift laser resurfacing, we do aesthetics, spa aesthetics, skin revitalization treatment,  for good measure. Check more @ Cool Laser Facial Skin Treatment Info e61d047
回复

使用道具 举报

FrankJScott | 昨天 21:33 | 显示全部楼层 来自 英国

Great Bathroom Renovation Blog

To the person asking about bathroom contractor, kitchen improvement, room remodeling, high end bathroom remodel, home addition contractors, basement refinishers, free renovation, kitchen remodel with financing, kitchen new jersey, attic bathroom renovation, wc remodeling, laundry remodeling, home and remodeling, kitchens with views, kitchen bath remodel, all in 1 home improvement, home improvement general contractors near me, free kitchen remodel, modern home improvement, bathroom remodel with financing, the new bathroom, new kitchen remodel,  I can vouch for this right here about bathroom contracting url for home basement remodeling, new construction and remodeling, painting remodeling services, angie construction, renovation services, long home improvement, modern home renovation before and after, nj basement, renovation of room, home improvement services near me, new bathroom, home construction llc, top bathroom remodelers, home kitchen renovation, bathroom remodel general contractor near me, contractor for home renovation, bedroom into bathroom, bath redo, morris home improvement, bathroom remodel bathroom, free home improvement projects, also. See More High Rated TAJIR4D Website 6043b3f
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则