Spring Web Flow Tip: Result of evaluate in transition May Interrupt the Transition

If you use an <evaluate> within a <transition>, be ware that the outcome of evaluate actions may cancel the execution of the transition if the result is false, no. As the result, the flow stays at the current view-state. To avoid such behavior, you should use <set> instead.

Caller Flow:

<flow xmlns="http://www.springframework.org/schema/webflow"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">

    <subflow-state id="loginfirst" subflow="login">
        <input name="user" value="'Jack'"/>
        <transition on="login-success" to="welcome">
            <evaluate expression="currentEvent.attributes.loginReturn" result="flowScope.loginStatus"></evaluate>
        </transition>
        <transition on="login-error" to="thanks">
            <!-- evaluate expression="currentEvent.attributes.loginReturn" result="flowScope.loginStatus"></evaluate—>
<set name="flowScope.loginStatus" value="currentEvent.attributes.loginReturn"></set>

        </transition>
    </subflow-state>

    <view-state id="welcome" view="../A.jsp">
        <transition on="next" to="intro" />
        <transition on="skip" to="thanks"/>
    </view-state>
    <view-state id="intro" view="../B.jsp">
        <transition on="back" to="intro"></transition>
        <transition on="next" to="thanks"></transition>
    </view-state>
    <view-state id="thanks" view="../C.jsp"></view-state>

</flow>

Callee flow:

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

    <input name="user" />
    <view-state id="login-form" view="../login-form.jsp">
        <transition on="success" to="login-success" />
        <transition on="cancel" to="login-error"/>
    </view-state>
    <end-state id="login-success" view="../login-success.jsp">
        <output name="loginReturn" value="true"/>
    </end-state>
    <end-state id="login-error" view="../login-error.jsp">
        <output name="loginReturn" value="false"/>
    </end-state>

</flow>