activiti获取个人历史任务businessKey

 //历史任务实例
        List historicTaskInstanceList = historyService // 历史相关Service
                .createHistoricTaskInstanceQuery() // 创建历史任务实例查询
                .taskAssignee(assignee.toString())
//                .finished() // 查询已经完成的任务
                .list();

        //历史实例过程查询
        List historicProcessInstancesList = historyService.createHistoricProcessInstanceQuery()
                .processInstanceIds(historicTaskInstanceList.stream().map(TaskInfo::getProcessInstanceId).collect(Collectors.toSet()))
                .list();

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

        List follows = followDao.findByUserId(assignee);

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

 

你可能感兴趣的:(activiti)