Spring Boot 整合 Activiti 工作流引擎 極簡教程
package com.example.actividemo;
import org.activiti.engine.HistoryService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.repository.DeploymentBuilder;
import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("activityService")
public class ActivityConsumerServiceImpl implements ActivityConsumerService {
@Autowired
private RuntimeService runtimeService;
@Autowired
private TaskService taskService;
@Autowired
private HistoryService historyService;
@Autowired
private RepositoryService repositoryService;
/**
* 註冊一個流程
*
* @return
*/
@Override
public boolean createDeployment() {
DeploymentBuilder builder =外匯跟單gendan5.com repositoryService.createDeployment();
builder.addClasspathResource("test01.bpmn20.xml");
builder.deploy();
return true;
}
/**
* 查詢待辦
*
* @return
*/
public List getTaskList() {
return historyService.createHistoricActivityInstanceQuery().list();
}
/**
* 根據流程 key 開啟一個流程
*
* @param key
* @return
*/
@Override
public boolean startActivityDemo(String key) {
ProcessInstance test01 = runtimeService.startProcessInstanceByKey(key);
String id = test01.getId();
System.out.println(" 流程 id=" + id);
return true;
}
/**
* 根據任務 id 提交任務
*
* @param taskId
* @return
*/
@Override
public boolean complete(String taskId) {
taskService.complete(taskId);
return true;
}
/**
* 根據流程 id 直接結束流程
*
* @param runId
* @return
*/
@Override
public boolean deleteProcessInstance(String runId) {
runtimeService.deleteProcessInstance(runId, " 結束 ");
return true;
}
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69946337/viewspace-2778197/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 極簡 Spring Boot 整合 Thymeleaf 頁面模板Spring Boot
- activiti工作流引擎元件元件
- springboot 整合 activiti 流程引擎Spring Boot
- Spring Boot (三)模板引擎FreeMarker整合Spring Boot
- Spring Boot (四)模板引擎Thymeleaf整合Spring Boot
- Activiti7 與 Spring Boot 及 Spring Security 整合 踩坑記錄Spring Boot
- Spring Boot整合swagger使用教程Spring BootSwagger
- Spring Boot 簡單整合 LiquibaseSpring BootUI
- Activiti工作流-簡介篇
- spring boot MySQL極簡封裝Spring BootMySql封裝
- 工作流引擎Activiti與SpringBoot2整合--開源軟體誕生17Spring Boot
- Spring Boot 整合 Spring Security 入門案例教程Spring Boot
- Spring Boot 最佳實踐(三)模板引擎FreeMarker整合Spring Boot
- Spring Boot系列十六 WebSocket簡介和spring boot整合簡單訊息代理Spring BootWeb
- Activiti6.0 spring5 工作流引擎 java SSM流程審批 專案框架SpringJavaSSM框架
- Activiti6.0 java專案框架 spring5 SSM 工作流引擎 審批流程Java框架SpringSSM
- java Activiti6.0 後臺 框架 spring5 SSM 工作流引擎 審批流程Java框架SpringSSM
- RabbitMQ(三):RabbitMQ與Spring Boot簡單整合MQSpring Boot
- Spring security(四)-spring boot +spring security簡訊認證+redis整合Spring BootRedis
- Spring Boot+Spring Security+Thymeleaf 簡單教程Spring Boot
- Spring Boot整合Spring BatchSpring BootBAT
- Spring Boot整合Spring AopSpring Boot
- Spring Boot整合Spring SecuritySpring Boot
- java Activiti 工作流引擎 SSM 框架模組設計方案JavaSSM框架
- 十分鐘認識Activiti6.0工作流引擎
- Spring Boot系列十九 Spring boot整合 swaggerSpring BootSwagger
- Spring Boot 2.0(八):Spring Boot 整合 MemcachedSpring Boot
- Spring Boot中實現規則引擎原始碼教程Spring Boot原始碼
- Spring Boot中整合機器學習簡介Spring Boot機器學習
- Spring Boot 最簡單整合 Shiro+JWT 方式Spring BootJWT
- Spring Boot 整合 Lombok 讓程式碼更簡潔Spring BootLombok
- Spring Boot 整合 KafkaSpring BootKafka
- Spring Boot 整合 MyBatisSpring BootMyBatis
- Spring Boot整合SwaggerSpring BootSwagger
- Spring Boot整合rabbitmqSpring BootMQ
- Spring Boot整合RedisSpring BootRedis
- Spring Boot 整合redisSpring BootRedis
- Spring Boot 整合 rabbitmqSpring BootMQ