Spring webflow:如何配置多个流程执行程序

时间:2012-11-21 06:31:19

标签: spring-webflow-2

我正在尝试为我的项目配置多个流执行程序,因为我需要一组带有'always-redirect-on-pause'属性为false而另一组为true的流。我试过搜索,浏览Spring Docs但是无法提供这种配置。任何人都可以分享这些配置和/或直接到一些相关资源?

谢谢

1 个答案:

答案 0 :(得分:2)

您可以在项目Spring配置文件中有多个工作流程(流程定义文件)位置注册

弹簧配置

    <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:webflow="http://www.springframework.org/schema/webflow-config"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
    http://www.springframework.org/schema/webflow-config
    http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd">

    <bean id="assetManagementService" />

    <bean id="savingsAssetService" />

    <bean id="handlerMapping">
        <property name="mappings">
            <value>/assetMgmtHomeView.htm=flowController</value>
        </property>
    </bean>

    <bean id="flowController">
        <property name="flowExecutor" ref="flowExecutor" />
    </bean>

    <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
    </webflow:flow-executor>

    <webflow:flow-registry id="flowRegistry">
        <webflow:flow-location id="assetMgmtHomeView" path="/WEB-INF/flows/assetMgmtFlow.xml" />
        <webflow:flow-location id="savingsAssetViewFlow" path="/WEB-INF/flows/savingsAssetViewFlow.xml" />
    </webflow:flow-registry>

</beans>

如您所见webflow:flow-registry包含两个工作流xml文件路径。请注意,这些位置注册具有不同的 ID ,用于区分工作流程。