返回介绍

15.2. Deployment

发布于 2023-09-17 23:40:35 字数 11830 浏览 0 评论 0 收藏 0

When using tomcat, please read Usage in Tomcat.

15.2.1. List of Deployments

GET repository/deployments
Table 21. URL query parameters
ParameterRequiredValueDescription
nameNoStringOnly return deployments with the given name.
nameLikeNoStringOnly return deployments with a name like the given name.
categoryNoStringOnly return deployments with the given category.
categoryNotEqualsNoStringOnly return deployments which don’t have the given category.
tenantIdNoStringOnly return deployments with the given tenantId.
tenantIdLikeNoStringOnly return deployments with a tenantId like the given value.
withoutTenantIdNoBooleanIf true, only returns deployments without a tenantId set. If false, the withoutTenantId parameter is ignored.
sortNoid (default), name, deployTime or tenantIdProperty to sort on, to be used together with the order.
Table 22. REST Response codes
Response codeDescription
200Indicates 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}
Table 23. Get a deployment - URL parameters
ParameterRequiredValueDescription
deploymentIdYesStringThe id of the deployment to get.
Table 24. Get a deployment - Response codes
Response codeDescription
200Indicates the deployment was found and returned.
404Indicates 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.

Table 25. Create a new deployment - Response codes
Response codeDescription
201Indicates the deployment was created.
400Indicates 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}
Table 26. Delete a deployment - URL parameters
ParameterRequiredValueDescription
deploymentIdYesStringThe id of the deployment to delete.
Table 27. Delete a deployment - Response codes
Response codeDescription
204Indicates the deployment was found and has been deleted. Response-body is intentionally empty.
404Indicates the requested deployment was not found.

15.2.5. List resources in a deployment

GET repository/deployments/{deploymentId}/resources
Table 28. List resources in a deployment - URL parameters
ParameterRequiredValueDescription
deploymentIdYesStringThe id of the deployment to get the resources for.
Table 29. List resources in a deployment - Response codes
Response codeDescription
200Indicates the deployment was found and the resource list has been returned.
404Indicates 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}
Table 30. Get a deployment resource - URL parameters
ParameterRequiredValueDescription
deploymentIdYesStringThe id of the deployment the requested resource is part of.
resourceIdYesStringThe 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.
Table 31. Get a deployment resource - Response codes
Response codeDescription
200Indicates both deployment and resource have been found and the resource has been returned.
404Indicates 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}
Table 32. Get a deployment resource content - URL parameters
ParameterRequiredValueDescription
deploymentIdYesStringThe id of the deployment the requested resource is part of.
resourceIdYesStringThe 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 codeDescription
200Indicates both deployment and resource have been found and the resource data has been returned.
404Indicates 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文