Browse Source

优化流程逻辑

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

11
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<HistoricTaskInstance> 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);

Loading…
Cancel
Save