From 02abeef1466046ba18e4ad791a072921277ed3c7 Mon Sep 17 00:00:00 2001 From: smallchill Date: Sun, 11 Aug 2019 23:32:41 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/FlowBusinessServiceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/impl/FlowBusinessServiceImpl.java b/blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/impl/FlowBusinessServiceImpl.java index eb66a0d1..2cbf3be1 100644 --- a/blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/impl/FlowBusinessServiceImpl.java +++ b/blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/impl/FlowBusinessServiceImpl.java @@ -149,10 +149,13 @@ public class FlowBusinessServiceImpl implements FlowBusinessService { flow.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory())); flow.setProcessInstanceId(historicProcessInstance.getId()); // HistoricTaskInstance - HistoricTaskInstance historyTask = historyService.createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstance.getId()).orderByHistoricTaskInstanceEndTime().desc().list().get(0); - flow.setTaskId(historyTask.getId()); - flow.setTaskName(historyTask.getName()); - flow.setTaskDefinitionKey(historyTask.getTaskDefinitionKey()); + List historyTasks = historyService.createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstance.getId()).orderByHistoricTaskInstanceEndTime().desc().list(); + if (Func.isNotEmpty(historyTasks)) { + HistoricTaskInstance historyTask = historyTasks.iterator().next(); + flow.setTaskId(historyTask.getId()); + flow.setTaskName(historyTask.getName()); + flow.setTaskDefinitionKey(historyTask.getTaskDefinitionKey()); + } // Status if (historicProcessInstance.getEndActivityId() != null) { flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED);