소스 검색

异常捕获

caixiaofeng 6 달 전
부모
커밋
2f1b208217
1개의 변경된 파일26개의 추가작업 그리고 14개의 파일을 삭제
  1. 26 14
      flow-workflow/flow-workflow-biz/src/main/java/com/flow/service/impl/FlowTaskServiceImpl.java

+ 26 - 14
flow-workflow/flow-workflow-biz/src/main/java/com/flow/service/impl/FlowTaskServiceImpl.java

@@ -192,10 +192,14 @@ public class FlowTaskServiceImpl extends BaseServiceImpl<FlowTaskDao, FlowTask>
             }
         }
         // 回退节点
-        managementService.executeCommand(new JumpActivityCmd(
-                task.getProcessInstanceId(),
-                taskForm.getTargetNode()
-        ));
+        try {
+            managementService.executeCommand(new JumpActivityCmd(
+                    task.getProcessInstanceId(),
+                    taskForm.getTargetNode()
+            ));
+        } catch (Exception e) {
+            throw new BaseException(e.getMessage());
+        }
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -242,22 +246,30 @@ public class FlowTaskServiceImpl extends BaseServiceImpl<FlowTaskDao, FlowTask>
     @Override
     public void addSign(AddSignTaskForm taskForm) {
         Task taskInfo = this.comment(taskForm);
-        managementService.executeCommand(new AddTaskExecutionCmd(
-                taskInfo.getProcessInstanceId(),
-                taskInfo.getTaskDefinitionKey(),
-                taskForm.getAssignee())
-        );
+        try {
+            managementService.executeCommand(new AddTaskExecutionCmd(
+                    taskInfo.getProcessInstanceId(),
+                    taskInfo.getTaskDefinitionKey(),
+                    taskForm.getAssignee())
+            );
+        } catch (Exception e) {
+            throw new BaseException(e.getMessage());
+        }
     }
 
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void removeSign(AddSignTaskForm taskForm) {
         Task taskInfo = this.comment(taskForm);
-        managementService.executeCommand(new DeleteTaskExecutionCmd(
-                taskInfo.getProcessInstanceId(),
-                taskInfo.getTaskDefinitionKey(),
-                taskInfo.getAssignee()
-        ));
+        try {
+            managementService.executeCommand(new DeleteTaskExecutionCmd(
+                    taskInfo.getProcessInstanceId(),
+                    taskInfo.getTaskDefinitionKey(),
+                    taskInfo.getAssignee()
+            ));
+        } catch (Exception e) {
+            throw new BaseException(e.getMessage());
+        }
     }
 
     @Transactional(rollbackFor = Exception.class)