在 Spring Webflow 中设置多个 if else 条件决策状态 id

Setting multiple if else condition decision-state id in Spring Webflow

我正在处理现有的 Spring Webflow 应用程序。我在子流程中设置了一个变量,我想使用决策状态来确定操作 class。该应用程序已指定决策状态 ID

<decision-state id="condition1">
        <if test="flowScope.conditionCheck1 || flowScope.conditionCheck2" then="action1" else="action2"/>
</decision-state>

现在我想测试 condition3 是否成立,如果成立,我想执行 action3。有人知道我该怎么做吗?

像这样拆分您的条件和决策状态:

<decision-state id="condition1">
    <if test="flowScope.conditionCheck3" then="action3" else="condition1or2"/>
</decision-state>
<decision-state id="condition1or2">
    <if test="flowScope.conditionCheck1 || flowScope.conditionCheck1" then="action1" else="action2"/>
</decision-state>

为了写 if else 条件,我在 "decision-state-id" 中写了多个 if 条件,else 条件写在最后一个 if 条件中,对我来说效果很好。

<decision-state id="condition1">
    <if test="flowScope.conditionCheck1 || flowScope.conditionCheck2" then="action1"/>
    <if test="flowScope.conditionCheck3 then="action3" else="action2"/>
</decision-state>