为了保障原创作者在本站发表文章的利益, 并维护本站原创的精神, 特声明: RIAShanghai对有以下任何情况之一的文章将不通知作者并直接进行快意删除:
- 非原创, 或者原创但一文多发;
- 各种形式的广告与吹擂;
- 不符合本站文章格式.
欢迎各位读者监督. 谢谢合作. 另: 作为Adobe正式的UG, 我们将把Adobe不定期分发的软件,书籍及各种纪念品赠送给发文活跃的作者, 共同进步.
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>