update - 优化任务校验的异常文案
This commit is contained in:
parent
59e5063058
commit
31c1df316d
@ -85,9 +85,6 @@ public class CustomApproveTaskCmd implements Command<Void>, Serializable {
|
||||
HistoricTaskInstance historicTaskInstance = taskQuery.taskId(taskId).singleResult();
|
||||
|
||||
Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
|
||||
if (Objects.isNull(task)) {
|
||||
log.info("任务不存在: {}", taskId);
|
||||
}
|
||||
validTask(historicTaskInstance, (TaskEntity) task, approver);
|
||||
|
||||
if (StringUtils.hasLength(advice)) {
|
||||
|
||||
@ -100,7 +100,8 @@ public class CustomTaskHelper {
|
||||
*/
|
||||
public static void validTask(HistoricTaskInstance historicTaskInstance, TaskEntity taskEntity,
|
||||
BpmnTaskDelegateAssigner originTaskAssigner) {
|
||||
if (Objects.nonNull(historicTaskInstance) && Objects.nonNull(historicTaskInstance.getEndTime())) {
|
||||
if (Objects.nonNull(historicTaskInstance) &&
|
||||
(Objects.nonNull(historicTaskInstance.getEndTime()) || Objects.isNull(taskEntity))) {
|
||||
throw new WorkflowEngineException(TASK_HAS_BEEN_COMPLETE);
|
||||
}
|
||||
|
||||
@ -194,6 +195,7 @@ public class CustomTaskHelper {
|
||||
task.setProcessInstanceId(processInstanceId);
|
||||
return addComment(commandContext, task, type, message);
|
||||
}
|
||||
|
||||
public static Comment addComment(CommandContext commandContext, Task task, String type, String message) {
|
||||
ProcessEngineConfigurationImpl processEngineConfiguration =
|
||||
CommandContextUtil.getProcessEngineConfiguration(commandContext);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user