[jboss-user] [jBPM Users] - List task comments with Activity name

edeleflie do-not-reply at jboss.com
Tue Nov 24 20:07:28 EST 2009


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 ->
    println(task.getActivityName())
    task.comments.each { comment ->
        println(comment.getMessage())
    }
}



View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267431#4267431

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267431



More information about the jboss-user mailing list