JBoss Community

Re: how to get the history tasks list use jbpm5,it's best to show the code,thanks!

created by xiaoxiao long in jBPM - View the full discussion

I hava acheive this function :

public ModelAndView historyTasks(HttpServletRequest request,Task task){
  ModelAndView mv = new ModelAndView();
  ModelMap mp = new ModelMap("historyTasks");
  StatefulKnowledgeSession ksession = jbpmSupport.getKsession();
  TaskService taskService = jbpmSupport.getTaskService();
  String username = (String) request.getSession().getAttribute("uname");

  String sqlquery = "from Task where status='Completed'and createdBy_id='"+username+"'";
  List<Task> tasks = (List<Task>) taskService.query(sqlquery, sqlquery.length(), 0);
  mp.put("tasks", tasks);
  mp.put("task", task);



Reply to this message by going to Community

Start a new discussion in jBPM at Community