|
@@ -10,10 +10,7 @@ import com.aizuda.boot.modules.flw.flow.FlowForm;
|
|
|
import com.aizuda.boot.modules.flw.flow.FlowHelper;
|
|
|
import com.aizuda.boot.modules.flw.mapper.FlowlongMapper;
|
|
|
import com.aizuda.boot.modules.flw.service.*;
|
|
|
-import com.aizuda.bpm.engine.FlowDataTransfer;
|
|
|
-import com.aizuda.bpm.engine.FlowLongEngine;
|
|
|
-import com.aizuda.bpm.engine.ProcessService;
|
|
|
-import com.aizuda.bpm.engine.TaskService;
|
|
|
+import com.aizuda.bpm.engine.*;
|
|
|
import com.aizuda.bpm.engine.core.FlowCreator;
|
|
|
import com.aizuda.bpm.engine.core.enums.PerformType;
|
|
|
import com.aizuda.bpm.engine.core.enums.ProcessType;
|
|
@@ -47,6 +44,7 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
|
@AllArgsConstructor
|
|
|
public class ProcessTaskServiceImpl implements IProcessTaskService {
|
|
|
+ private final RuntimeService runtimeService;
|
|
|
private FlowlongMapper flowlongMapper;
|
|
|
private FlwExtInstanceMapper extInstanceMapper;
|
|
|
private FlowLongEngine flowLongEngine;
|
|
@@ -297,6 +295,11 @@ public class ProcessTaskServiceImpl implements IProcessTaskService {
|
|
|
ApiAssert.isEmpty(flwTask, "当前ID执行任务不存在");
|
|
|
TaskService taskService = flowLongEngine.taskService();
|
|
|
this.processApprovalOpinion(dto.getReason());
|
|
|
+ if (dto.isTermination()) {
|
|
|
+ // 驳回并终止流程
|
|
|
+ runtimeService.reject(flwTask.getInstanceId(), FlowHelper.getFlowCreator());
|
|
|
+ return true;
|
|
|
+ }
|
|
|
return taskService.rejectTask(flwTask, FlowHelper.getFlowCreator(), dto.getArgs()).isPresent();
|
|
|
}
|
|
|
|