Commit 1bb10d007efc68e59864519d00f5edc6b242f895
1 parent
e8b3f355
增加流程模型实体激活或挂起后端逻辑
Showing
3 changed files
with
65 additions
and
1 deletions
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/process/ProcessDefinitionDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.process; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * 流程模型实体类 映射 activiti ProcessDefinition接口 | |
| 5 | + * | |
| 6 | + * @author ZJQ | |
| 7 | + * @date 2021/9/7 23:23 | |
| 8 | + */ | |
| 9 | +public class ProcessDefinitionDO { | |
| 10 | + | |
| 11 | + private String id; | |
| 12 | + | |
| 13 | + private String category; | |
| 14 | + | |
| 15 | + private String key; | |
| 16 | + | |
| 17 | + private String name; | |
| 18 | + | |
| 19 | + private String version; | |
| 20 | + | |
| 21 | + private String resourceName; | |
| 22 | + | |
| 23 | + private String deploymentId; | |
| 24 | + | |
| 25 | + private String diagramResourceName; | |
| 26 | + | |
| 27 | + private boolean suspended; | |
| 28 | + | |
| 29 | +} | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/process/ProcessService.java
| ... | ... | @@ -11,8 +11,19 @@ import org.springframework.web.multipart.MultipartFile; |
| 11 | 11 | public interface ProcessService { |
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | - * 上传流程文件,进行流程部署 | |
| 14 | + * 上传流程文件,进行流程模型部署 | |
| 15 | 15 | * @param multipartFile 上传文件 |
| 16 | 16 | */ |
| 17 | 17 | void deployProcess(MultipartFile multipartFile); |
| 18 | + | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * 激活或者挂起流程模型实体 | |
| 22 | + * @param processDefinitionId 流程模型实体id | |
| 23 | + * @param type 类型 | |
| 24 | + * @return 状态 | |
| 25 | + */ | |
| 26 | + String setActivOrHang(String processDefinitionId,String type); | |
| 27 | + | |
| 28 | + | |
| 18 | 29 | } | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/process/impl/ProcessServiceImpl.java
| ... | ... | @@ -54,6 +54,30 @@ public class ProcessServiceImpl implements ProcessService { |
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + /** | |
| 58 | + * 激活或者挂起流程模型实体 | |
| 59 | + * @param processDefinitionId 流程模型实体id | |
| 60 | + * @param type 类型 | |
| 61 | + * @return 提示 | |
| 62 | + */ | |
| 63 | + @Override | |
| 64 | + public String setActivOrHang(String processDefinitionId, String type) { | |
| 65 | + String result = "无操作"; | |
| 66 | + switch (type){ | |
| 67 | + case "active": | |
| 68 | + repositoryService.activateProcessDefinitionById(processDefinitionId,true,null); | |
| 69 | + result = "已激活ID为【"+processDefinitionId+"】的流程模型实例"; | |
| 70 | + break; | |
| 71 | + case "suspend": | |
| 72 | + repositoryService.suspendProcessDefinitionById(processDefinitionId,true,null); | |
| 73 | + result = "已挂起ID为【"+processDefinitionId+"】的流程模型实例"; | |
| 74 | + break; | |
| 75 | + default: | |
| 76 | + break; | |
| 77 | + } | |
| 78 | + return result; | |
| 79 | + } | |
| 80 | + | |
| 57 | 81 | |
| 58 | 82 | /** |
| 59 | 83 | * 根据上传文件类型对应实现不同方式的流程部署 | ... | ... |