flowable集成spring boot ---- 意见表与附件表

flowable的数据表中有act_hi_comment和act_hi_attachment两张表,前者为意见表后者为附件表

act_hi_comment:
在这里插入图片描述
只有 TYPE_,TIME_,ACTION_ 这三个参数会自动生成, TASK_ID_,PROC_INST_ID_ 这两个参数,如果调用接口时候不设置,就不会有,.
type可以自定义,例如自定义为:通过/退回/提前终止(add时调用有type字段的方法即可),缺省提供了comment,event是事件,当给附件表增加记录时,它就会在意见表同时增加多少条记录,并且type的类型为event。所以取意见时,需要注意这个问题。

comment提供了以下方法,全部在TaskService中:

/** 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);

有以下几点需要注意:
  1、addComment才是新增,saveComment是修改。
  2、addComment应在操作流程之前。例如当前流程节点待完成的任务添加comment,应该先addComment,再进行complete.
  3、comment中有两个审批信息字段:message和fullMessage。message保存的是审批信息的前163个字段内容,而fullMessage保存的是longblob类型的完整审批内容信息,因此获取审批内容时,要获取fullMeaage的内容而不是message。

附件提供了以下方法:

/**
 * 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);
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值