Flowable 6.6.0 表单 - 3.Spring 集成 - 3.2 自动资源部署(Automatic resource deployment)

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)

3.Spring 集成(Spring integration)

3.2 自动资源部署(Automatic resource deployment)

Spring integration also has a special feature for deploying resources. In the Form engine configuration, you can specify a set of resources. When the Form engine is created, all those resources will be scanned and deployed. There is filtering in place that prevents duplicate deployments. Only when the resources actually have changed will new deployments be deployed to the Flowable Form DB. This makes sense in a lot of use cases, where the Spring container is rebooted often (for example, testing).
Here’s an example:
Spring integration还有一个用于部署资源的特殊特性。在表单引擎配置中,可以指定一组资源。创建表单引擎时,将扫描并部署所有这些资源。有防止重复部署的过滤。只有当资源实际发生更改时,才会将新部署部署到Flowable Form DB中。这在很多用例中都是有意义的,其中Spring容器经常重新启动(例如,测试)。
下面是一个例子:

<bean id="formEngineConfiguration" class="org.flowable.spring.SpringFormEngineConfiguration">
  ...
  <property name="deploymentResources"
    value="classpath*:/org/flowable/spring/test/autodeployment/autodeploy/*.form" />
</bean>

<bean id="formEngine" class="org.flowable.form.spring.FormEngineFactoryBean">
  <property name="formEngineConfiguration" ref="formEngineConfiguration" />
</bean>

By default, the configuration above will group all of the resources matching the filtering into a single deployment to the Flowable Form engine. The duplicate filtering to prevent re-deployment of unchanged resources applies to the whole deployment. In some cases, this may not be what you want. For instance, if you deploy a set of Form resources this way and only a single Form definition in those resources has changed, the deployment as a whole will be considered new and all of the process definitions in that deployment will be re-deployed, resulting in new versions of each of the Form definitions, even though only one was actually changed.

默认情况下,将通过一个单独的配置将上述匹配过滤的所有资源到组合到Flowable 表单引擎的单个部署中。防止重新部署未更改资源的重复筛选适用于整个部署。在某些情况下,这可能不是你想要的。例如,如果您以这种方式部署一组表单资源,而这些资源中只有一个表单定义发生了更改,则整个部署将被视为新部署,并且该部署中的所有流程定义都将重新部署,从而生成每个表单定义的新版本,即使只有一个表单定义被改变了。

To be able to customize the way deployments are determined, you can specify an additional property in the SpringFormEngineConfiguration, deploymentMode. This property defines the way deployments will be determined from the set of resources that match the filter. There are 3 values that are supported by default for this property:

为了能够自定义确定部署的方式,您可以在SpringFormEngineConfiguration中指定一个附加属性deploymentMode。此属性定义根据与筛选器匹配的资源集确定部署的方式。此属性默认支持3个值:

  • default: Group all resources into a single deployment and apply duplicate filtering to that deployment. This is the default value and it will be used if you don’t specify a value.
  • default:将所有资源分组到单个部署中,并对该部署应用重复筛选。这是默认值,如果不指定值,将使用它。
  • single-resource: Create a separate deployment for each individual resource and apply duplicate filtering to that deployment. This is the value you would use to have each Form definition be deployed separately and only create a new Form definition version if it has changed.
  • single-resource:为每个单独的资源创建单独的部署,并对该部署应用重复筛选。此值用于单独部署每个表单定义,并且仅在表单定义发生更改时创建新的表单定义版本。
  • resource-parent-folder: Create a separate deployment for resources that share the same parent folder and apply duplicate filtering to that deployment. This value can be used to create separate deployments for most resources, but still be able to group some by placing them in a shared folder. Here’s an example of how to specify the single-resource configuration for deploymentMode:
  • resource-parent-folder:为共享同一父文件夹的资源创建单独的展开,并对该部署应用重复筛选。此值可用于:为大多数资源创建单独的部署,但仍可通过将某些资源放在共享文件夹中对其进行分组。以下是如何为deploymentMode指定单个资源配置的示例:
<bean id="formEngineConfiguration"
    class="org.flowable.form.spring.SpringFormEngineConfiguration">
  ...
  <property name="deploymentResources" value="classpath*:/flowable/*.form" />
  <property name="deploymentMode" value="single-resource" />
</bean>

In addition to using the values listed above for deploymentMode, you may require customized behavior towards determining deployments. If so, you can create a subclass of SpringFormEngineConfiguration and override the getAutoDeploymentStrategy(String deploymentMode) method. This method determines which deployment strategy is used for a certain value of the deploymentMode configuration.

除了为deploymentMode使用上面列出的值外,您可能需要自定义行为来确定部署。如果是这样,您可以创建SpringFormEngineConfiguration的子类,并重写getAutoDeploymentStrategy(String deploymentMode)方法。此方法确定将哪个部署策略用于deploymentMode配置的特定值。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

月满闲庭

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

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

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

打赏作者

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

抵扣说明:

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

余额充值