9 Replies Latest reply on Nov 26, 2009 1:48 PM by Ronald van Kuijk

    List task comments with Activity name

    Etienne Deleflie Newbie

      I'm finding the HistoryService's API slightly criptic.

      I'd like to display, for any given ProcessInstance, all the activity-names it passed through, and the list of comments added each of those tasks.

      what I do is retrieve all the HistoryTasks. Then use their Id's to retrieve all the HistoryComments. ... but the HistoryTask does not give me the activity name! (it gives me the outcome, however).

      To get the activity-name, I have to go into a completely separate API space ... via the HistoryActivityInstanceQuery. Then I can do HistoryActivityInstance.getActivityName(). But this object does not expose access to comments!

      I can find no programmatic way to associate a HistoryActivityInstance with a HistoryTask .. meaning that I have no way to associate Task Comments to their task's activity names.

      Have I missed something? .. is there a way to retrieve comments listed by activity name?

      I feel as though JBPM4's API is driven by something other than end-user logic. Maybe it is driven by some complex DB restrictions or something. I dont understand why I cant do (groovy syntax):

      tasks = History.getTasks(proccessInstanceId)
      tasks.each { task ->
      task.comments.each { comment ->