activiti獲取個人歷史任務businessKey

 //歷史任務實例
        List<HistoricTaskInstance> historicTaskInstanceList = historyService // 歷史相關Service
                .createHistoricTaskInstanceQuery() // 創建歷史任務實例查詢
                .taskAssignee(assignee.toString())
//                .finished() // 查詢已經完成的任務
                .list();

        //歷史實例過程查詢
        List<HistoricProcessInstance> historicProcessInstancesList = historyService.createHistoricProcessInstanceQuery()
                .processInstanceIds(historicTaskInstanceList.stream().map(TaskInfo::getProcessInstanceId).collect(Collectors.toSet()))
                .list();

        //獲取businessKey
        List<ApprovalTemp> collect = historicProcessInstancesList.stream().map(e -> {
            return new ApprovalTemp().setBusinessKey(e.getBusinessKey()).setName(e.getName()).setCreateTime(e.getStartTime()).setTaskId(e.getId());
        }).collect(Collectors.toList());

        List<Follow> follows = followDao.findByUserId(assignee);

        List<ApprovalDTO> list = approvalDTO(follows, collect);
//    ..........

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章