Browse Source

优化流程逻辑

test
smallchill 6 years ago
parent
commit
02abeef146
  1. 5
      blade-ops/blade-flow/src/main/java/org/springblade/flow/business/service/impl/FlowBusinessServiceImpl.java

5
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.setCategoryName(FlowCache.getCategoryName(processDefinition.getCategory()));
flow.setProcessInstanceId(historicProcessInstance.getId()); flow.setProcessInstanceId(historicProcessInstance.getId());
// HistoricTaskInstance // HistoricTaskInstance
HistoricTaskInstance historyTask = historyService.createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstance.getId()).orderByHistoricTaskInstanceEndTime().desc().list().get(0); List<HistoricTaskInstance> historyTasks = historyService.createHistoricTaskInstanceQuery().processInstanceId(historicProcessInstance.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
if (Func.isNotEmpty(historyTasks)) {
HistoricTaskInstance historyTask = historyTasks.iterator().next();
flow.setTaskId(historyTask.getId()); flow.setTaskId(historyTask.getId());
flow.setTaskName(historyTask.getName()); flow.setTaskName(historyTask.getName());
flow.setTaskDefinitionKey(historyTask.getTaskDefinitionKey()); flow.setTaskDefinitionKey(historyTask.getTaskDefinitionKey());
}
// Status // Status
if (historicProcessInstance.getEndActivityId() != null) { if (historicProcessInstance.getEndActivityId() != null) {
flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED); flow.setProcessIsFinished(FlowEngineConstant.STATUS_FINISHED);

Loading…
Cancel
Save