0
点赞
收藏
分享

微信扫一扫

Flowable入门系列文章140 - 任务 14

E_topia 2022-02-08 阅读 30

1、获取任务上的所有附件

表1.获取任务上的所有附件 - URL参数

参数需要描述
任务id获取附件的任务的ID。

成功回应机构:

[
{
"id":"3",
"url":"http://localhost:8182/runtime/tasks/2/attachments/3",
"name":"Simple attachment",
"description":"Simple attachment description",
"type":"simpleType",
"taskUrl":"http://localhost:8182/runtime/tasks/2",
"processInstanceUrl":null,
"externalUrl":"http://flowable.org",
"contentUrl":null
},
{
"id":"5",
"url":"http://localhost:8182/runtime/tasks/2/attachments/5",
"name":"Binary attachment",
"description":"Binary attachment description",
"type":"binaryType",
"taskUrl":"http://localhost:8182/runtime/tasks/2",
"processInstanceUrl":null,
"externalUrl":null,
"contentUrl":"http://localhost:8182/runtime/tasks/2/attachments/5/content"
}
]

表2.获取任务上的所有附件 - 响应代码

响应码描述
200表示找到任务并返回附件。
404表示找不到请求的任务。

2、获取任务的附件

表3.获取任务附件 - URL参数

参数需要描述
任务id获取附件的任务的ID。
附件ID附件的ID。

成功回应机构:

{
"id":"5",
"url":"http://localhost:8182/runtime/tasks/2/attachments/5",
"name":"Binary attachment",
"description":"Binary attachment description",
"type":"binaryType",
"taskUrl":"http://localhost:8182/runtime/tasks/2",
"processInstanceUrl":null,
"externalUrl":null,
"contentUrl":"http://localhost:8182/runtime/tasks/2/attachments/5/content"
}
  • externalUrl - contentUrl:如果附件是指向外部资源的链接,则externalUrl包含外部内容的URL。如果附件内容存在于Flowable引擎中,contentUrl则将包含二进制内容可以从中流动的URL。
  • type:可以是任意的值。当包含有效格式化的媒体类型(例如application / xml,text / plain)时,二进制内容HTTP响应内容类型将被设置为给定值。

表4.获取任务附件 - 响应代码

响应码描述
200表示找到任务和附件,并返回附件。
404指示未找到请求的任务,或者任务没有给定ID的附件。
举报

相关推荐

0 条评论