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工作流引擎元件元件
- 工作流引擎:jbpm和activiti
- Spring Boot (四)模板引擎Thymeleaf整合Spring Boot
- Spring Boot (三)模板引擎FreeMarker整合Spring Boot
- springboot 整合 activiti 流程引擎Spring Boot
- Activiti工作流-簡介篇
- Activiti7 與 Spring Boot 及 Spring Security 整合 踩坑記錄Spring Boot
- spring boot MySQL極簡封裝Spring BootMySql封裝
- Spring Boot 簡單整合 LiquibaseSpring BootUI
- Spring Boot中整合機器學習簡介Spring Boot機器學習
- Spring Boot 整合 Spring Security 入門案例教程Spring Boot
- Spring Boot整合swagger使用教程Spring BootSwagger
- 工作流引擎Activiti與SpringBoot2整合--開源軟體誕生17Spring Boot
- java Activiti 工作流引擎 SSM 框架模組設計方案JavaSSM框架
- Spring Boot系列十六 WebSocket簡介和spring boot整合簡單訊息代理Spring BootWeb
- Spring Boot 最佳實踐(三)模板引擎FreeMarker整合Spring Boot
- Activiti6.0 spring5 工作流引擎 java SSM流程審批 專案框架SpringJavaSSM框架
- java Activiti6.0 後臺 框架 spring5 SSM 工作流引擎 審批流程Java框架SpringSSM
- Activiti6.0 java專案框架 spring5 SSM 工作流引擎 審批流程Java框架SpringSSM
- 十分鐘認識Activiti6.0工作流引擎
- RabbitMQ(三):RabbitMQ與Spring Boot簡單整合MQSpring Boot
- spring整合mina簡明教程Spring
- Spring Boot中實現規則引擎原始碼教程Spring Boot原始碼
- Spring Boot 2.0(八):Spring Boot 整合 MemcachedSpring Boot
- Spring Boot(十八):使用 Spring Boot 整合 FastDFSSpring BootAST
- Spring Boot 整合 Lombok 讓程式碼更簡潔Spring BootLombok
- Spring Boot+Spring Security+Thymeleaf 簡單教程Spring Boot
- Spring Boot整合rabbitmqSpring BootMQ
- Spring Boot 整合 rabbitmqSpring BootMQ
- Spring Boot 整合 elasticsearchSpring BootElasticsearch
- Spring Boot 整合 dockerSpring BootDocker
- Spring Boot 整合 elkSpring Boot
- Spring Boot 整合 ApolloSpring Boot
- Spring Boot整合RedisSpring BootRedis
- Spring Boot 整合redisSpring BootRedis
- Spring Boot 整合 MyBatisSpring BootMyBatis
- Spring Boot整合SocketSpring Boot