jpaas-bpm 依赖项目与第三方库
jpaas-bpm是平台的重要流程业务支撑后端子项目,它依赖了以下几块:
平台子模块
- jpaas-auth 统一认证
- jpaas-gateway 网关
- jpaas-config 配置中心
- jpaas-system 系统管理
- jpaas-form 表单管理
- jpaas-user 用户管理
- jpaas-share 公共实体模块
公共模块Starter
除了以上平台的模块外,还依赖了平台的公共模块:
<dependency>
<groupId>com.redxun</groupId>
<artifactId>jpaas-common-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.redxun</groupId>
<artifactId>jpaas-cache-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.redxun</groupId>
<artifactId>jpaas-db-spring-boot-starter</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.redxun</groupId>
<artifactId>jpaas-redis-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.redxun</groupId>
<artifactId>jpaas-ribbon-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.redxun</groupId>
<artifactId>jpaas-sentinel-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.redxun</groupId>
<artifactId>jpaas-job-spring-boot-starter</artifactId>
</dependency>
<!-- swagger -->
<dependency>
<groupId>com.redxun</groupId>
<artifactId>jpaas-swagger2-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>com.redxun</groupId>
<artifactId>jpaas-web-spring-boot-starter</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
Activiti 7 依赖
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter</artifactId>
<version>7.1.0.M6</version>
<exclusions>
<exclusion>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
</exclusion>
</exclusions>
</dependency>
说明:需要把security的模块与mybatis的模块排除,以使得它依赖的版本跟我们外置的版本不一致引起的其他问题。
分布事务seata依赖
流程子模块除了依赖以上模块外,还依赖了seata,该模块实现了分布式的事务,在流程启动,流程任务审批时,需要通过分布式事务实现单据的数据保存,流程业务流转。
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-alibaba-seata</artifactId>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>io.seata</groupId>
<artifactId>seata-all</artifactId>
</dependency>
开启此功能,只需要在application.yml中增加以下配置:
seata:
enabled: true
application-id: ${spring.application.name}
tx-service-group: bpm_tx_group
enable-auto-data-source-proxy: true
registry:
type: nacos
nacos:
application: seata-server
server-addr: ${nacos.address}
group: DEFAULT_GROUP
userName: nacos
password: nacos
config:
type: nacos
nacos:
namespace:
serverAddr: ${nacos.address}
group: SEATA_GROUP
cluster: default
userName: nacos
password: nacos
spring boot与spring alibaba的依赖
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-micro-spring-boot-starter</artifactId>
</dependency>
说明:knife4j为swagger的接口文档UI界面依赖
代码运行
依赖数据库jpaas-bpm
先在数据库中创建jpaas-bpm,请参考4.平台源码运行的脚本执行。
nacos的数据库配置
依赖了nacos的,需要在nacos中配置流程模块的数据库连接:
进入nacos的配置,找到相应的环境的配置文件,如在开发环境下使用的是dev的配置文件:
进入编辑页,把以下的配置修改为对应的数据库连接即可:
运行依赖
需要优先启动以下几个模块
- nacos
- seata
- jpaas-auth
- jpaas-gateway
- jpaas-system
- jpaas-user
然后再运行本模块即可,即执行JPaasBpmApplication类即可。
文档更新时间: 2020-10-12 09:25 作者:csx