(四)Flowable中TaskServiceAPI详解

Flowable中TaskServiceAPI详解

1.Comment addComment​(String taskId,String processInstanceId,String message)
向任务和/或流程实例添加注释。

2.Comment addComment​(String taskId,String processInstanceId,String type,String message)
使用自定义类型向任务和/或流程实例添加注释。

3.void saveComment​(Comment comment)
更新任务和/或流程实例的注释。

4.Comment getComment​(String commentId)
返回具有给定id的单个注释。如果给定id没有注释,则返回null。

5.void deleteComments​(String taskId,String processInstanceId)
从提供的任务和/或流程实例中删除所有注释。

6.void deleteComment​(String commentId)
删除具有给定id的单个注释。
抛出:
flowableobjectnotfoundexception -当给定id没有注释存在时。

7.List getTaskComments​(String taskId)
与给定任务相关的注释。

8.List getTaskComments​(String taskId,String type)
与给定类型的给定任务相关的注释。

9.List getCommentsByType​(String type)
给定类型的所有注释。

10.List getTaskEvents​(String taskId)
与给定任务相关的所有事件。

11.Event getEvent​(String eventId)
返回具有给定id的单个事件。如果给定id的事件不存在,则返回null。

12.List getProcessInstanceComments​(String processInstanceId)
与给定流程实例相关的注释。

13.List getProcessInstanceComments​(String processInstanceId,String type)
与给定流程实例相关的注释。

14.Attachment createAttachment​(String attachmentType,String taskId,String processInstanceId,String attachmentName,String attachmentDescription,InputStream content)
向任务和/或流程实例添加新附件,并使用输入流提供内容

15.Attachment createAttachment​(String attachmentType,String taskId,String processInstanceId,String attachmentName,String attachmentDescription,String url)
向任务和/或流程实例添加新的附件,并使用url作为内容

16.void saveAttachment​(Attachment attachment)
更新附件的名称和描述

17.Attachment getAttachment​(String attachmentId)
检索特定的附件

18.InputStream getAttachmentContent​(String attachmentId)
检索特定附件的流内容

19.List getTaskAttachments​(String taskId)
与任务关联的附件列表

20.List getProcessInstanceAttachments​(String processInstanceId)
与流程实例相关联的附件列表

21.void deleteAttachment​(String attachmentId)
删除附件

22.List<org.flowable.task.api.Task> getSubTasks​(String parentTaskId)
此父任务的子任务列表

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Flowable是RxJava2的一个子集,它提供了一些额外的方法和特性来处理背压问题,可以处理大量数据和高负载的场景。下面是Flowable API的详解: 1. 创建Flowable对象 - Flowable.just(item1, item2, item3, ...):创建一个发射固定数据项的Flowable对象。 - Flowable.fromArray(items):创建一个发射数组所有数据项的Flowable对象。 - Flowable.fromCallable(callable):创建一个发射Callable返回值的Flowable对象。 - Flowable.fromPublisher(publisher):将一个Publisher对象转换为一个Flowable对象。 - Flowable.fromIterable(iterable):创建一个发射Iterable所有数据项的Flowable对象。 2. 变换Flowable对象 - map(function):对发射的每个数据项应用一个函数,返回一个新的Flowable对象。 - flatMap(function):对发射的每个数据项应用一个函数,返回一个新的Flowable对象,将所有的Flowable对象发射的数据项合并成一个Flowable对象。 - concatMap(function):类似于flatMap,但是保证顺序,依次处理每个数据项,不会交叉处理。 - switchMap(function):类似于flatMap,但是只处理最新的数据项,忽略旧的数据项。 3. 过滤Flowable对象 - filter(predicate):筛选出发射的数据项满足条件的数据项。 - distinct():去除重复的数据项。 - take(count):仅发射前count个数据项。 - skip(count):跳过前count个数据项。 - takeWhile(predicate):仅发射满足条件的数据项,直到不满足条件为止。 - skipWhile(predicate):跳过满足条件的数据项,直到不满足条件为止。 4. 操作Flowable对象 - doOnNext(action):在每个数据项发射之前执行一个操作。 - doOnComplete(action):在完成时执行一个操作。 - doOnError(action):在发生错误时执行一个操作。 - onErrorResumeNext(function):当发生错误时,返回一个新的Flowable对象来继续发射数据项。 - onErrorReturnItem(item):当发生错误时,返回一个指定的数据项来终止发射数据项。 5. 处理背压问题 - onBackpressureBuffer():缓存所有发射的数据项,如果缓存区已满,则抛出MissingBackpressureException异常。 - onBackpressureDrop():丢弃所有发射的数据项,如果缓存区已满,则不会抛出异常。 - onBackpressureLatest():仅缓存最新的数据项,如果缓存区已满,则覆盖最老的数据项。 以上仅列举了部分Flowable API,还有很多其他的方法和特性可以根据实际需求进行选择和使用。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值