cancel
Showing results for 
Search instead for 
Did you mean: 

Add comments on completed tasks

smartxiaofish
Champ in-the-making
Champ in-the-making
currently,  add a comment on a task is attached on TaskService, and TaskService is operating on task that has not been finished.

Comment org.activiti.engine.TaskService.addComment(String taskId, String processInstanceId, String message)


I try to add a comment on a completed task, and it shows org.activiti.engine.ActivitiObjectNotFoundException: Cannot find task with id xx.

is it possible to add a comment on a finished task ?

thanks for any help~
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

The problem is that task is runtime object. When the task is completed the row is deleted from runtime tables. That's why it is not possible to add comment to already deleted object.
There is still track of task in the history tables. (I am not keen on the idea to change history. 🙂 ). There is no API to change the history (only to delete object)

Regards
Martin

smartxiaofish
Champ in-the-making
Champ in-the-making
thanks for reply.
i understand why i can't add comment on finished( which is in history) task using TaskService.
but it seems that Comments are some kind of history objects, as its table named "act_hi_comment". and Comments are just a connection to historicTaskIntances.  i guess there is no harm to add a comment to a finished task, especially a completed task. and actually in real world, i think sometimes we really need to comment on a task which has just been completed.

trademak
Star Contributor
Star Contributor
Right, that use case is valid of course. We currently only support adding comments on open tasks. So it would be a feature request to change this.

Best regards,