Flowable 6.6.0表单 - 1.配置 - 1.1 创建一个表单引擎(Creating a Form Engine)

培训视频推荐

CSDN上提供了Flowable 6.6.0的系列培训视频课程,欢迎有兴趣的朋友前往学习。

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

1 表单配置(Configuration)

1.1创建一个表单引擎(Creating a Form Engine)
1.2 FormEngineConfiguration bean
1.3 插入流程引擎(Plug into Process Engine)
1.4 数据库配置(Database configuration)
1.5 JNDI数据源配置(JNDI Datasource Configuration)
1.6 数据库相关
1.7 部署缓存配置(Deployment cache configuration)
1.8 日志(Logging)

2.表单API

2.1 表单引擎API及服务
2.2 异常策略(Exception strategy)
2.3 查询API(Query API)
2.4 单元测试(Unit testing)
2.5 Web应用程序中的表单引擎(The Form engine in a web application)

3.Spring 集成

3.1 FormEngineFactoryBean
3.2 自动资源部署(Automatic resource deployment)
3.3 单元测试(Unit testing)

4 部署(Deployment)
5 表单简介(Form Introduction)
6 REST API
Flowable

Flowable 6.6.0表单用户指南(Forms User Guide)

1 配置(Configuration)

1.1创建一个表单引擎(Creating a Form Engine)

The Flowable Form engine is structured in a very similar way to the Flowable process engine. As a result parts of the documentation have a resemblance with their process engine counterpart.
The Flowable Form engine is configured through an XML file named flowable.form.cfg.xml. Note that this is not applicable if you’re using the Spring style of building a Form engine.
The easiest way to obtain a FormEngine, is to use the org.flowable.form.engine.FormEngines class:

FormEngine formEngine = FormEngines.getDefaultFormEngine()

Flowable表单引擎的结构与流程引擎非常相似。因此,文档的某些部分与它们对应的流程引擎相似。
Flowable表单引擎是通过flowable.form.cfg.xml文件配置的。请注意,如果使用Spring样式构建表单引擎(the Spring style of building a Form engine),则这不适用。
获取FormEngine的最简单方法是使用org.flowable.form.engine.FormEngines类:

FormEngine formEngine = FormEngines.getDefaultFormEngine()

This will look for a flowable.form.cfg.xml file on the classpath and construct an engine based on the configuration in that file. The following snippet shows an example configuration. The following sections will give a detailed overview of the configuration properties.
这将在classpath上寻找flowable.form.cfg.xml 文件,并基于文件中的配置构造一个引擎。下面的代码片段显示了一个配置示例。以下部分将详细概述配置属性。

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="formEngineConfiguration" 
  class="org.flowable.form.engine.impl.cfg.StandaloneFormEngineConfiguration">

    <property name="jdbcUrl" value="jdbc:h2:mem:flowable;DB_CLOSE_DELAY=1000" />
    <property name="jdbcDriver" value="org.h2.Driver" />
    <property name="jdbcUsername" value="sa" />
    <property name="jdbcPassword" value="" />

    <property name="databaseSchemaUpdate" value="true" />

  </bean>

</beans>

Note that the configuration XML is, in fact, a Spring configuration. This does not mean that Flowable Form can only be used in a Spring environment! We are simply leveraging the parsing and dependency injection capabilities of Spring internally for building up the engine.
The FormEngineConfiguration object can also be created programmatically using the configuration file. It is also possible to use a different bean id (for example, see line 3).
注意,配置XML实际上是一个Spring配置。这并不意味着Flowable Form只能在Spring环境中使用!我们只是在内部利用Spring的解析和依赖注入功能来构建引擎。
FormEngineConfiguration对象也可以以编程方式使用配置文件创建。也可以使用不同的bean id(例如,请参见第3行)。

FormEngineConfiguration.
  createFormEngineConfigurationFromResourceDefault();
  createFormEngineConfigurationFromResource(String resource);
  createFormEngineConfigurationFromResource(String resource, String beanName);
  createFormEngineConfigurationFromInputStream(InputStream inputStream);
  createFormEngineConfigurationFromInputStream(InputStream inputStream, String beanName);

It is also possible not to use a configuration file, and create a configuration based on defaults (see the different supported classes for more information).
也可以不使用配置文件,而基于默认值创建配置(有关更多信息,请参阅不同的支持类(the different supported classes))。

FormEngineConfiguration.createStandaloneFormEngineConfiguration();
FormEngineConfiguration.createStandaloneInMemFormEngineConfiguration();

All these FormEngineConfiguration.createXXX() methods return a FormEngineConfiguration that can further be tweaked if needed. After calling the buildFormEngine() operation, a FormEngine is created:
所有这些都是为了FormEngineConfiguration.createXXX()方法返回一个FormEngineConfiguration,如果需要,可以进一步调整该配置。调用buildFormEngine()操作后,将创建一个FormEngine:

FormEngine formEngine = 
FormEngineConfiguration.createStandaloneInMemFormEngineConfiguration()
  .setDatabaseSchemaUpdate(FormEngineConfiguration.DB_SCHEMA_UPDATE_FALSE)
  .setJdbcUrl("jdbc:h2:mem:my-own-db;DB_CLOSE_DELAY=1000")
  .buildFormEngine();

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

月满闲庭

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

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

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

打赏作者

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

抵扣说明:

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

余额充值