jpaas-bpm 依赖项目与第三方库

jpaas-bpm是平台的重要流程业务支撑后端子项目,它依赖了以下几块:

平台子模块

  1. jpaas-auth 统一认证
  2. jpaas-gateway 网关
  3. jpaas-config 配置中心
  4. jpaas-system 系统管理
  5. jpaas-form 表单管理
  6. jpaas-user 用户管理
  7. jpaas-share 公共实体模块

公共模块Starter

除了以上平台的模块外,还依赖了平台的公共模块:

  1. <dependency>
  2. <groupId>com.redxun</groupId>
  3. <artifactId>jpaas-common-spring-boot-starter</artifactId>
  4. </dependency>
  5. <dependency>
  6. <groupId>com.redxun</groupId>
  7. <artifactId>jpaas-cache-spring-boot-starter</artifactId>
  8. </dependency>
  9. <dependency>
  10. <groupId>com.redxun</groupId>
  11. <artifactId>jpaas-db-spring-boot-starter</artifactId>
  12. <version>1.2</version>
  13. </dependency>
  14. <dependency>
  15. <groupId>com.redxun</groupId>
  16. <artifactId>jpaas-redis-spring-boot-starter</artifactId>
  17. </dependency>
  18. <dependency>
  19. <groupId>com.redxun</groupId>
  20. <artifactId>jpaas-ribbon-spring-boot-starter</artifactId>
  21. </dependency>
  22. <dependency>
  23. <groupId>com.redxun</groupId>
  24. <artifactId>jpaas-sentinel-spring-boot-starter</artifactId>
  25. </dependency>
  26. <dependency>
  27. <groupId>com.redxun</groupId>
  28. <artifactId>jpaas-job-spring-boot-starter</artifactId>
  29. </dependency>
  30. <!-- swagger -->
  31. <dependency>
  32. <groupId>com.redxun</groupId>
  33. <artifactId>jpaas-swagger2-spring-boot-starter</artifactId>
  34. </dependency>
  35. <dependency>
  36. <groupId>com.redxun</groupId>
  37. <artifactId>jpaas-web-spring-boot-starter</artifactId>
  38. <version>1.0-SNAPSHOT</version>
  39. <scope>compile</scope>
  40. </dependency>

Activiti 7 依赖

  1. <dependency>
  2. <groupId>org.activiti</groupId>
  3. <artifactId>activiti-spring-boot-starter</artifactId>
  4. <version>7.1.0.M6</version>
  5. <exclusions>
  6. <exclusion>
  7. <groupId>org.mybatis</groupId>
  8. <artifactId>mybatis</artifactId>
  9. </exclusion>
  10. <exclusion>
  11. <groupId>org.springframework.security</groupId>
  12. <artifactId>spring-security-core</artifactId>
  13. </exclusion>
  14. </exclusions>
  15. </dependency>

说明:需要把security的模块与mybatis的模块排除,以使得它依赖的版本跟我们外置的版本不一致引起的其他问题。

分布事务seata依赖

流程子模块除了依赖以上模块外,还依赖了seata,该模块实现了分布式的事务,在流程启动,流程任务审批时,需要通过分布式事务实现单据的数据保存,流程业务流转。

  1. <dependency>
  2. <groupId>com.alibaba.cloud</groupId>
  3. <artifactId>spring-cloud-alibaba-seata</artifactId>
  4. </dependency>
  5. <dependency>
  6. <groupId>io.seata</groupId>
  7. <artifactId>seata-spring-boot-starter</artifactId>
  8. </dependency>
  9. <dependency>
  10. <groupId>io.seata</groupId>
  11. <artifactId>seata-all</artifactId>
  12. </dependency>

开启此功能,只需要在application.yml中增加以下配置:

  1. seata:
  2. enabled: true
  3. application-id: ${spring.application.name}
  4. tx-service-group: bpm_tx_group
  5. enable-auto-data-source-proxy: true
  6. registry:
  7. type: nacos
  8. nacos:
  9. application: seata-server
  10. server-addr: ${nacos.address}
  11. group: DEFAULT_GROUP
  12. userName: nacos
  13. password: nacos
  14. config:
  15. type: nacos
  16. nacos:
  17. namespace:
  18. serverAddr: ${nacos.address}
  19. group: SEATA_GROUP
  20. cluster: default
  21. userName: nacos
  22. password: nacos

spring boot与spring alibaba的依赖

  1. <dependency>
  2. <groupId>org.springframework.security.oauth</groupId>
  3. <artifactId>spring-security-oauth2</artifactId>
  4. </dependency>
  5. <dependency>
  6. <groupId>org.springframework.boot</groupId>
  7. <artifactId>spring-boot-starter-web</artifactId>
  8. </dependency>
  9. <dependency>
  10. <groupId>com.alibaba.cloud</groupId>
  11. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
  12. </dependency>
  13. <dependency>
  14. <groupId>org.springframework</groupId>
  15. <artifactId>spring-context-support</artifactId>
  16. </dependency>
  17. <dependency>
  18. <groupId>org.springframework.boot</groupId>
  19. <artifactId>spring-boot-starter-actuator</artifactId>
  20. </dependency>
  21. <dependency>
  22. <groupId>com.github.xiaoymin</groupId>
  23. <artifactId>knife4j-micro-spring-boot-starter</artifactId>
  24. </dependency>

说明:knife4j为swagger的接口文档UI界面依赖

代码运行

依赖数据库jpaas-bpm

先在数据库中创建jpaas-bpm,请参考4.平台源码运行的脚本执行。

nacos的数据库配置

依赖了nacos的,需要在nacos中配置流程模块的数据库连接:

进入nacos的配置,找到相应的环境的配置文件,如在开发环境下使用的是dev的配置文件:

进入编辑页,把以下的配置修改为对应的数据库连接即可:

运行依赖

需要优先启动以下几个模块

  1. nacos
  2. seata
  3. jpaas-auth
  4. jpaas-gateway
  5. jpaas-system
  6. jpaas-user

然后再运行本模块即可,即执行JPaasBpmApplication类即可。

文档更新时间: 2020-10-12 09:25   作者:csx