ProcessInstanceComments for list of tasks

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2015 04:44 PM
I have a list of about 300 tasks that I display in a table. For each task a user can add comments (which are added to the process on the backend). When I retrieve the list of tasks to display, before rendering this list I iterate it and retrieve comments by using:
List<Comment> comments = taskService.getProcessInstanceComments(task.getProcessInstanceId(), "comment");
Then I display the number of comments for each row, so users know if there is a comment for a specific process. The problem is that the ACT_HI_COMMENT table now has over 350,000 rows and it keeps growing, so the comment retrieval for a list of 300 tasks takes close to a minute.
Is there a better way to accomplish this?
List<Comment> comments = taskService.getProcessInstanceComments(task.getProcessInstanceId(), "comment");
Then I display the number of comments for each row, so users know if there is a comment for a specific process. The problem is that the ACT_HI_COMMENT table now has over 350,000 rows and it keeps growing, so the comment retrieval for a list of 300 tasks takes close to a minute.
Is there a better way to accomplish this?
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2015 01:55 PM
I ended up taking a CustomSqlExecution direction. I left joined the ACT_HI_COMMENT table in my custom mapper select statement and it seems to work much faster now.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2015 03:59 AM
Hi Ivan,
Yes you can optimize the query. Another thing is that you have to archive history (History will keep growing….)
Regards
Martin
Yes you can optimize the query. Another thing is that you have to archive history (History will keep growing….)
Regards
Martin
