- 1. 简介
- 2. 开始
- 3. 配置
- 4. Flowable API
- 5. 集成 Spring
- 6. 部署
- 7. BPMN 2.0 介绍
- 8. BPMN 2.0 结构
- 9. 表单
- 10. JPA
- 11. 历史
- 12. 身份管理
- 13. Eclipse Designer
- 14. Flowable UI 应用
- 15. REST API
- 16. 集成 CDI
- 17. 集成 LDAP
- 18. 高级
- 19. 工具
15.2. Deployment
When using tomcat, please read Usage in Tomcat.
15.2.1. List of Deployments
GET repository/deployments
Parameter | Required | Value | Description |
---|---|---|---|
name | No | String | Only return deployments with the given name. |
nameLike | No | String | Only return deployments with a name like the given name. |
category | No | String | Only return deployments with the given category. |
categoryNotEquals | No | String | Only return deployments which don’t have the given category. |
tenantId | No | String | Only return deployments with the given tenantId. |
tenantIdLike | No | String | Only return deployments with a tenantId like the given value. |
withoutTenantId | No | Boolean | If true , only returns deployments without a tenantId set. If false , the withoutTenantId parameter is ignored. |
sort | No | id (default), name, deployTime or tenantId | Property to sort on, to be used together with the order. |
Response code | Description |
---|---|
200 | Indicates the request was successful. |
Success response body:
{
"data": [
{
"id": "10",
"name": "flowable-examples.bar",
"deploymentTime": "2010-10-13T14:54:26.750+02:00",
"category": "examples",
"url": "http://localhost:8081/flowable-rest/service/repository/deployments/10",
"tenantId": null
}
],
"total": 1,
"start": 0,
"sort": "id",
"order": "asc",
"size": 1
}
15.2.2. Get a deployment
GET repository/deployments/{deploymentId}
Parameter | Required | Value | Description |
---|---|---|---|
deploymentId | Yes | String | The id of the deployment to get. |
Response code | Description |
---|---|
200 | Indicates the deployment was found and returned. |
404 | Indicates the requested deployment was not found. |
Success response body:
{
"id": "10",
"name": "flowable-examples.bar",
"deploymentTime": "2010-10-13T14:54:26.750+02:00",
"category": "examples",
"url": "http://localhost:8081/flowable-rest/service/repository/deployments/10",
"tenantId" : null
}
15.2.3. Create a new deployment
POST repository/deployments
Request body:
The request body should contain data of type multipart/form-data. There should be exactly one file in the request, any additional files will be ignored. The deployment name is the name of the file-field passed in. If multiple resources need to be deployed in a single deployment, compress the resources in a zip and make sure the file-name ends with .bar
or .zip
.
An additional parameter (form-field) can be passed in the request body with name tenantId
. The value of this field will be used as the id of the tenant this deployment is done in.
Response code | Description |
---|---|
201 | Indicates the deployment was created. |
400 | Indicates there was no content present in the request body or the content mime-type is not supported for deployment. The status-description contains additional information. |
Success response body:
{
"id": "10",
"name": "flowable-examples.bar",
"deploymentTime": "2010-10-13T14:54:26.750+02:00",
"category": null,
"url": "http://localhost:8081/flowable-rest/service/repository/deployments/10",
"tenantId" : "myTenant"
}
15.2.4. Delete a deployment
DELETE repository/deployments/{deploymentId}
Parameter | Required | Value | Description |
---|---|---|---|
deploymentId | Yes | String | The id of the deployment to delete. |
Response code | Description |
---|---|
204 | Indicates the deployment was found and has been deleted. Response-body is intentionally empty. |
404 | Indicates the requested deployment was not found. |
15.2.5. List resources in a deployment
GET repository/deployments/{deploymentId}/resources
Parameter | Required | Value | Description |
---|---|---|---|
deploymentId | Yes | String | The id of the deployment to get the resources for. |
Response code | Description |
---|---|
200 | Indicates the deployment was found and the resource list has been returned. |
404 | Indicates the requested deployment was not found. |
Success response body:
[
{
"id": "diagrams/my-process.bpmn20.xml",
"url": "http://localhost:8081/flowable-rest/service/repository/deployments/10/resources/diagrams%2Fmy-process.bpmn20.xml",
"dataUrl": "http://localhost:8081/flowable-rest/service/repository/deployments/10/resourcedata/diagrams%2Fmy-process.bpmn20.xml",
"mediaType": "text/xml",
"type": "processDefinition"
},
{
"id": "image.png",
"url": "http://localhost:8081/flowable-rest/service/repository/deployments/10/resources/image.png",
"dataUrl": "http://localhost:8081/flowable-rest/service/repository/deployments/10/resourcedata/image.png",
"mediaType": "image/png",
"type": "resource"
}
]
mediaType
: Contains the media-type the resource has. This is resolved using a (pluggable)MediaTypeResolver
and contains, by default, a limited number of mime-type mappings.type
: Type of resource, possible values:resource
: Plain old resource.processDefinition
: Resource that contains one or more process-definitions. This resource is picked up by the deployer.processImage
: Resource that represents a deployed process definition’s graphical layout.
The dataUrl property in the resulting JSON for a single resource contains the actual URL to use for retrieving the binary resource.
15.2.6. Get a deployment resource
GET repository/deployments/{deploymentId}/resources/{resourceId}
Parameter | Required | Value | Description |
---|---|---|---|
deploymentId | Yes | String | The id of the deployment the requested resource is part of. |
resourceId | Yes | String | The id of the resource to get. Make sure you URL-encode the resourceId in case it contains forward slashes. Eg: use diagrams%2Fmy-process.bpmn20.xml instead of diagrams/Fmy-process.bpmn20.xml. |
Response code | Description |
---|---|
200 | Indicates both deployment and resource have been found and the resource has been returned. |
404 | Indicates the requested deployment was not found or there is no resource with the given id present in the deployment. The status-description contains additional information. |
Success response body:
{
"id": "diagrams/my-process.bpmn20.xml",
"url": "http://localhost:8081/flowable-rest/service/repository/deployments/10/resources/diagrams%2Fmy-process.bpmn20.xml",
"dataUrl": "http://localhost:8081/flowable-rest/service/repository/deployments/10/resourcedata/diagrams%2Fmy-process.bpmn20.xml",
"mediaType": "text/xml",
"type": "processDefinition"
}
mediaType
: Contains the media-type the resource has. This is resolved using a (pluggable)MediaTypeResolver
and contains, by default, a limited number of mime-type mappings.type
: Type of resource, possible values:resource
: Plain old resource.processDefinition
: Resource that contains one or more process-definitions. This resource is picked up by the deployer.processImage
: Resource that represents a deployed process definition’s graphical layout.
15.2.7. Get a deployment resource content
GET repository/deployments/{deploymentId}/resourcedata/{resourceId}
Parameter | Required | Value | Description |
---|---|---|---|
deploymentId | Yes | String | The id of the deployment the requested resource is part of. |
resourceId | Yes | String | The id of the resource to get the data for. Make sure you URL-encode the resourceId in case it contains forward slashes. Eg: use diagrams%2Fmy-process.bpmn20.xml instead of diagrams/Fmy-process.bpmn20.xml. |
.Get a deployment resource content - Response codes
Response code | Description |
---|---|
200 | Indicates both deployment and resource have been found and the resource data has been returned. |
404 | Indicates the requested deployment was not found or there is no resource with the given id present in the deployment. The status-description contains additional information. |
Success response body:
The response body will contain the binary resource-content for the requested resource. The response content-type will be the same as the type returned in the resources mimeType property. Also, a content-disposition header is set, allowing browsers to download the file instead of displaying it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论