/** * 查询任务 * @author Administrator * */ public class Test04 { public static void main(String[] args) { ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine(); //得到任务服务 TaskService tkService = processEngine.getTaskService(); //查询所有的任务 List<Task> list = tkService.createTaskQuery().list(); System.out.println("共有几个任务"+list.size()); //遍历集合取得每一条任务(查询所有的人的所有任务 for(Task tk : list){ System.out.println(tk.getAssignee()); } System.out.println("============"); // 得到的责任人查询任务id (根据责任人来查询他的任务 List<Task> list2 = tkService.createTaskQuery() .taskAssignee("张老师").list(); for(Task tk2:list2){ System.out.println(tk2.getId()); } } }