flowable实战(六)flowable的意见表和附件表应用
作者:互联网
一、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);
(二)附件提供了以下方法:
/**
* Add a new attachment to a task and/or a process instance and use an input stream to provide the content
*/
Attachment createAttachment(String attachmentType, String taskId, String processInstanceId, String attachmentName, String attachmentDescription, InputStream content);
/**
* Add a new attachment to a task and/or a process instance and use an url as the content
*/
Attachment createAttachment(String attachmentType, String taskId, String processInstanceId, String attachmentName, String attachmentDescription, String url);
/** Update the name and description of an attachment */
void saveAttachment(Attachment attachment);
/** Retrieve a particular attachment */
Attachment getAttachment(String attachmentId);
/** Retrieve stream content of a particular attachment */
InputStream getAttachmentContent(String attachmentId);
/** The list of attachments associated to a task */
List<Attachment> getTaskAttachments(String taskId);
/** The list of attachments associated to a process instance */
List<Attachment> getProcessInstanceAttachments(String processInstanceId);
/** Delete an attachment */
void deleteAttachment(String attachmentId);
(三)真实应用:
标签:实战,comment,given,task,String,flowable,taskId,附件,type 来源: https://blog.51cto.com/u_10976476/2845650