开发
引入依赖
首先需要引入依赖,同时需要排除一些依赖来解决冲突。
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring-boot-starter</artifactId>
<version>7.1.0.M4</version>
<exclusions>
<!-- 由于activiti7是使用mybatis作为orm框架,我这里整合mybatis-plus,所以需要排除mybatis -->
<exclusion>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</exclusion>
<exclusion>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-api</artifactId>
</exclusion>
<exclusion>
<groupId>de.odysseus.juel</groupId>
<artifactId>juel-spi</artifactId>
</exclusion>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>
</dependency>
整合错误汇总
启动错误一
- 错误描述:
Description:
The bean 'securityManager', defined in class path resource [org/activiti/core/common/spring/security/config/ActivitiSpringSecurityAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [com/lidomtech/erp/admin/modules/security/config/ShiroConfig.class] and overriding is disabled.
Action:
Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
Disconnected from the target VM, address: '127.0.0.1:5571', transport: 'socket'
Process finished with exit code 0
- 解决错误:
Activiti默认引入了SpringSecurity,所以在启动类上排除SecurityAutoConfiguration.class、ManagementWebSecurityAutoConfiguration.class
@SpringBootApplication(exclude = {org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class, org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration.class})
启动错误二
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method springAsyncExecutor in org.activiti.spring.boot.AbstractProcessEngineAutoConfiguration required a single bean, but 3 were found:
- jmReportTaskExecutor: defined by method 'asyncServiceExecutor' in class path resource [org/jeecg/modules/jmreport/config/JmReportExecutorConfig.class]
- taskExecutor: defined by method 'taskExecutor' in class path resource [org/activiti/spring/boot/ProcessEngineAutoConfiguration.class]
- taskScheduler: defined by method 'taskScheduler' in class path resource [org/springframework/boot/autoconfigure/task/TaskSchedulingAutoConfiguration.class]
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
解决方案在启动类加入如下代码
@Primary
@Bean
public TaskExecutor primaryTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
return executor;
}
流程图配置
代理人
候选人
一个任务可以设置多个候选人,候选人在业务上指的是有权对该任务进行操作的群体。
某个候选人签收后,其他候选人就看不到该任务
候选组
任务回撤
https://blog.csdn.net/weixin_42174333/article/details/115632881
https://blog.csdn.net/wufaqidong1/article/details/128427063
Service接口 | 作用 |
---|---|
RepositoryService | 流程仓库Service,用于管理流程仓库,例如,部署、删除、读取流程资源 |
IdentifyService | 身份Service,可以管理和查询用户、组之间的关系 |
RuntimeService | 运行时Service,可以处理所有正在运行状态的流程实例、任务等 |
TaskService | 任务Service,用于管理、查询任务,例如,签收、办理、指派 |
FormService | 表单Service,用于读取和流程、任务相关的表单数据 |
HistoryService | 历史Service,可以查询所有历史数据,例如,流程实例、任务、活动、变量、附件等 |
ManagementService | 引擎管理Service,和具体业务无关,主要是可以查询引擎配置、数据库、作业等 |