javaspring-webflow

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


I am working on existing Spring Webflow application. I set a variable in a sub flow and I want to use decision state to determine the action class. The application already has decision state id specified

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

Now I want to test if condition3 holds true and in case it is true I want to execute action3. Does any one has any idea how can I do this?


Solution

  • To write if else condition i wrote multiple if conditions inside "decision-state-id" and else condition was written in the last if condition and it worked fine for me.

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