Flowable 6.6.0 事件注册表用户指南 - 6 REST API

Flowable 6.6.0 用户指南相关文档下载

Flowable 6.6.0 事件注册表用户指南

目录

1 事件注册表介绍

2 配置

3 Flowable 事件注册表API

4 Spring集成
5 部署

6 REST API


有关Flowable的更多文档,参见:

《Flowable文档大全》


Flowable 6.6.0 事件注册表用户指南PDF版下载

请点击:《事件注册表用户指南 - 中文PDF精编版》


6 REST API

6.1 Flowable REST一般原则

6.1.1 安装与认证

Flowable includes a REST API to the Flowable engine that can be installed by deploying the flowable-rest.war file to a servlet container like Apache Tomcat. However, it can also be used in another web-application by including the servlet (and/or its mappings) in your application and add all flowable-rest dependencies to the classpath.

Flowable包括一个到Flowable引擎的REST API,可以通过部署flowable-rest.war文件到一个servlet容器,比如Apache Tomcat,进行安装。但是,也可用于其他web应用程序,方式是在你的应用程序中包含其servlet(和其mappings),并增加flowable-rest依赖到classpath。

By default the Flowable engine will connect to an in-memory H2 database. You can change the database settings in the flowable-app.properties file in the WEB-INF/META-INF/flowable-app folder. The REST API uses JSON format (http://www.json.org) and is built upon the Spring MVC (http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html).

默认情况下,Flowable引擎将连接到内存中的H2数据库。您可以在WEB-INF/META-INF/flowable-app 文件夹的lowable-app.properties中更改数据库设置。REST API使用JSON格式(http://www.json.org)并且是建立在Spring MVC之上的(http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html)。

All REST-resources require a valid user with the rest-access-api privilege to be authenticated by default. If any valid user should be able to call the REST API, the flowable.rest.app.authentication-mode can be set to any-user (this was the default in older versions of Flowable).

默认情况下,所有REST资源(REST-resources)都需要具有rest-access-api 权限的有效用户进行身份验证。如果任何有效用户应该能够调用REST API,则可flowable.rest.app.authentication-mode可以设置为“ any-user”(这是早期版本的Flowable中的默认模式)。

A default user that can access the REST API can be configured by settings the following properties:

可以通过设置以下属性来配置可以访问REST API的默认用户:

flowable.rest.app.admin.user-id=rest-admin
flowable.rest.app.admin.password=test
flowable.rest.app.admin.first-name=Rest
flowable.rest.app.admin.last-name=Admin

When the REST app boots up, the user is created if it doesn’t exist or fetched otherwise. This user will be given the access-rest-api privilege which is needed by default to access the REST API. Do not forget to change the password of this user afterwards. If the flowable.rest.app.admin.user-id is not set, no users or privileges will be created. So, after the initial setup, removing this property will not remove the user nor the privilege that has been configured before.

当REST应用启动时,如果用户不存在,则创建该用户,否则获取该用户。此用户将被授予访问REST API的权限,默认情况下,该权限是访问REST API所必需的。以后不要忘记更改此用户的密码。如果 flowable.rest.app.admin.user-id 未设置,则不会创建任何用户或权限。因此,在初始设置之后,删除此属性不会删除用户或之前配置的权限。

Basic HTTP access authentication is used, so you should always include a Authorization: Basic …== HTTP-header when performing requests or include the username and password in the request-url (for example, http://username:password@localhost:8080/xyz).
We recommend that you use Basic Authentication in combination with HTTPS.
使用基本的HTTP访问身份验证,因此在执行请求时应始终包含一个Authorization: Basic …== HTTP-header,或者在request-url中包含用户名和密码(例如,http://username:password@localhost:8080/xyz)。
我们建议您将基本身份验证(Basic Authentication)与HTTPS结合使用。

6.1.2 配置

The Flowable REST web application uses Spring Java Configuration for starting the Flowable Form engine, defining the basic authentication security using Spring security, and to define the variable converters for specific variable handling. A small number of properties can be defined by changing the flowable-app.properties file you can find in the WEB-INF/META-INF/flowable-app/flowable-app.properties folder. If you need more advanced configuration options there’s the possibility to override the default Spring beans in XML in the flowable-custom-context.xml file you can also find in the WEB-INF/classes folder. An example configuration is already in comments in this file. This is also the place to override the default RestResponseFactory by defining a new Spring bean with the name restResponsefactory and use your custom implementation class for it.

Flowable REST Web应用程序使用SpringJ ava配置来启动Flowable表单引擎,使用Spring Security定义基本的身份验证安全性,并定义用于特定变量处理的变量转换器。可以通过更改flowable-app.properties文件来定义少量属性,flowable-app.properties文件可以在WEB-INF/META-INF/flowable-app/中找到。如果您需要更高级的配置选项,那么可以在flowable-custom-context.xml文件中覆盖XML中的默认Spring bean,flowable-custom-context.xml文件可以在WEB-INF/classes文件夹中找到。配置示例已在此文件的注释中。这也是重写默认RestResponseFactory的地方,方法是定义一个名为restResponsefactory的新Spring bean,并为它使用自定义实现类。

6.1.3 Tomcat中的用法

Due to default security properties on Tomcat, escaped forward slashes (%2F and %5C) are not allowed by default (400-result is returned). This may have an impact on the deployment resources and their data-URL, as the URL can potentially contain escaped forward slashes.

由于Tomcat上的默认安全属性,默认情况下不允许转义正斜杠(%2F和%5C)(返回400个结果)。这可能会对部署资源及其数据URL产生影响,因为URL可能包含转义的正斜杠。

When issues are experienced with unexpected 400-results, set the following system-property:

遇到问题并产生意外结果时,请设置以下系统属性:

-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

It’s best practice to always set the Accept and Content-Type (in case of posting/putting JSON) headers to application/json on the HTTP requests described below.

在下面描述的HTTP请求中,最好总是将Accept 和 Content-Type(在posting/putting JSON的情况下)头设置为application/json。


更多内容

更多REST API内容及Flowable 6.6.0 事件注册表用户指南其他内容,请查看:

目录

1 事件注册表介绍 6
1.1 什么是事件注册表? 6
1.2 什么是事件定义 6
1.3 什么是通道定义(CHANNEL DEFINITION) 7
2 配置 10
2.1 创建事件注册表引擎 10
2.2 EVENTREGISTRYENGINECONFIGURATION BEAN 12
2.3 插入流程引擎 13
2.4 数据库配置 14
2.5 JNDI 数据源配置 17
2.5.1 配置 17
2.5.2 JNDI 属性 18
2.5.3 自定义属性 19
2.6 支持的数据库 20
2.7 创建数据库表 21
2.8 数据库表名解释 22
2.9 数据库升级 23
2.10 部署缓存配置 24
2.11 LOGGING 24
3 FLOWABLE 事件注册表API 27
3.1 事件注册表引擎API与服务 27
3.2 异常策略 29
3.3 查询API 31
3.4 单元测试 31
3.5 WEB应用中的事件注册表引擎 34
4 SPRING集成 36
4.1 EVENTREGISTRYFACTORYBEAN 36
4.2 自动资源部署 37
4.3 单元测试 39
5 部署 41
5.1 事件注册表定义 41
5.1.1 事件定义 41
5.1.2 编程方式部署事件定义 42
5.1.3 通道定义 42
5.1.4 编程方式部署通道定义 43
5.1.5 Java类 43
5.1.6 创建独立的app 44
5.2 事件与通道定义的版本化 44
6 REST API 48
6.1 FLOWABLE REST一般原则 48
6.1.1 安装与认证 48
6.1.2 配置 49
6.1.3 Tomcat中的用法 50
6.1.4 方法与返回码 50
6.1.5 Error response body 52
6.1.6 请求参数 52
6.2 部署 55
6.2.1 事件注册表部署列表 55
6.2.2 获取一个事件注册表部署 57
6.2.3 创建一个事件注册表部署 58
6.2.4 删除一个事件注册表部署 59
6.2.5 获取一个事件注册表部署资源内容 59
6.3 事件定义 60
6.3.1 事件定义列表 61
6.3.2 获取一个事件定义 63
6.3.3 获取一个事件定义资源内容 63
6.3.4 获取一个事件定义模型 64
6.4 通道定义 65
6.4.1 通道定义列表 65
6.4.2 获取一个通道定义 67
6.4.3 获取一个通道定义资源内容 68
6.4.4 获取一个通道定义模型 68
6.5 事件注册表服务 69
6.5.1 发送一个事件 69
6.6 引擎 69
6.6.1 获取事件注册表引擎信息 69

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
本课程是《Flowable流程入门课程》的后续高级课程。在学习本课程前,应先学习入门课程,以掌握相关基础知识。高级课程着重讲解Flowable工作流的高级概念、复杂理论和实战应用。课程内容包括流程管理思想、技术与标准、工作流的控制模式和资源模式;Flowable数据库表及变量;与Spring、Spring Boot的集成;BPMN 2.0主要类图;Flowable高级服务如JAVA服务任务、脚本任务、Web Service任务、外部工作者任务、多实例任务、补偿处理程序、子流程和调用活动等;Flowable事件侦听器、执行侦听器和任务侦听器;Flowable历史和REST APIFlowable事务、并发性、身份管理及LDAP集成;Flowable高级主题如流程实例迁移、异步执行器的设计与配置、用于高并发的UUID ID生成器、多租户、高级流程引擎配置、执行自定义SQL和实验性流程调试器等;Flowable Eclipse设计器特性及定制;Flowable 事件注册;Flowable相关标准和规范如ISO8601标准和cron等。本课程对Flowable官方文档进行了彻底梳理和融汇贯通,并结合实践,形象生动、系统全面、简单易懂地呈现给大家,让大家从开源软件文档冗长耗时、英文晦涩难懂、概念理解困难、知识点分散等困境中解脱出来,从而能快速地将Flowable具有的高级特性应用到项目的高级需求和复杂实践中去。课程特色:案例和代码驱动、基础概念与经典实战相结合、知识环节融会贯通、关联知识平滑拓展、概念和原理展示形象生动。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

月满闲庭

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值