一、act_hi_comment和act_hi_attachment两表表,前者意见表后者是附件表
意见表它里面有一个类型type字段,分别是comment代表意见(这个type可以自定义,例如自定义为:通过/退回/提前终止),缺省提供了comment,event是事件,当你给附件表增加记录时,它就会在意见表同时增加多少条记录,并且type的类型为event。所以取意见时,需要注意这个问题。
(一)act_hi_comment提供了以下方法:
/** Add a comment to a task and/or process instance. */
Comment addComment(String taskId, String processInstanceId, String message);/** Add a comment to a task and/or process instance with a custom type. */
Comment addComment(String taskId, String processInstanceId, String type, String message);/** Update a comment to a task and/or process instance. */
void saveComment(Comment comment);/*** Returns an individual comment with the given id. Returns null if no comment exists with the given id.*/
Comment getComment(String commentId);/** Removes all comments from the provided task and/or process instance */
void deleteComments(String taskId, String processInstanceId);/*** Removes an individual comment with the given id.* * @throws FlowableObjectNotFoundException* when no comment exists with the given id.*/
void deleteComment(String commentId);/** The comments related to the given task. */
List<Comment> getTaskComments(String taskId);/** The comments related to the given task of the given type. */
List<Comment> getTaskComments(String taskId, String type);/** All comments of a given type. */
List<Comment> getCommentsByType(String type);/** The all events related to the given task. */
List<Event> getTaskEvents(String taskId);/*** Returns an individual event with the given id. Returns null if no event exists with the given id.*/
Event getEvent(String eventId);/** The comments related to the given process instance. */
List<Comment> getProcessInstanceComments(String processInstanceId);/** The comments related to the given process instance. */
List<Comment> getProcessInstanceComments(String processInstanceId, String type);
(三)真实应用: