Bladeren bron

修改查询,结束的也可以查询

xuefy 3 jaren geleden
bovenliggende
commit
cb2e95db1b

+ 2 - 1
flowable/src/main/java/com/huyi/flowable/controller/CloudSupplyChainController.java

@@ -10,6 +10,7 @@ import org.flowable.engine.IdentityService;
 import org.flowable.engine.RuntimeService;
 import org.flowable.engine.TaskService;
 import org.flowable.engine.history.HistoricActivityInstance;
+import org.flowable.engine.history.HistoricProcessInstance;
 import org.flowable.engine.runtime.ProcessInstance;
 import org.flowable.engine.task.Comment;
 import org.flowable.idm.api.User;
@@ -74,7 +75,7 @@ public class CloudSupplyChainController {
         typeSet.add(BpmnXMLConstants.ELEMENT_TASK_USER);
         typeSet.add(BpmnXMLConstants.ELEMENT_EVENT_START);
         typeSet.add(BpmnXMLConstants.ELEMENT_EVENT_END);
-        List<ProcessInstance> processInstanceList = runtimeService.createProcessInstanceQuery().processInstanceBusinessKey(businessKey).orderByStartTime().asc().list();
+        List<HistoricProcessInstance> processInstanceList = historyService.createHistoricProcessInstanceQuery().processInstanceBusinessKey(businessKey).orderByProcessInstanceStartTime().asc().list();
         if (processInstanceList.size() != 0) {
             List<HistoricActivityInstance> hisTaskList = historyService.createHistoricActivityInstanceQuery()
                     .processInstanceId(processInstanceList.get(0).getId())