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

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

精编Flowable 6.6.0 应用程序指南中文PDF版
精编Flowable 6.6.0 表单用户指南中文PDF版

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配置的特定值。

上一篇:React Native 本地热更新-安装客户端code-push-cli


下一篇:kubernetes 重启的几种方法