jboss seam自带的NumberGuess例子学习

自己是这样理解的,希望有人指点下,谢过先。

在pages.xml中加入页面流的配置:
    <page view-id="/numberGuess.jspx">
      <begin-conversation join="true" pageflow="numberGuess"/>
   </page>
当服务器启动的时候,页面流触发。

页面流文件:
<pageflow-definition
xmlns="http://jboss.com/products/seam/pageflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation=
    "http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-2.1.xsd"
name="numberGuess">
  
   <start-page name="displayGuess" view-id="/numberGuess.jspx">
      <redirect/>
      <transition name="guess" to="evaluateGuess">
         <action expression="#{numberGuess.guess}"/>
      </transition>
      <transition name="giveup" to="giveup"/>
      <transition name="cheat" to="cheat"/>
   </start-page>
  
   <decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
      <transition name="true" to="win"/>
      <transition name="false" to="evaluateRemainingGuesses"/>
   </decision>
  
   <decision name="evaluateRemainingGuesses" expression="#{numberGuess.lastGuess}">
      <transition name="true" to="lose"/>
      <transition name="false" to="displayGuess"/>
   </decision>
  
   <page name="giveup" view-id="/giveup.jspx">
      <redirect/>
      <transition name="yes" to="lose"/>
      <transition name="no" to="displayGuess"/>
   </page>
  
   <process-state name="cheat">
      <sub-process name="cheat"/>
      <transition to="displayGuess"/>
   </process-state>

   <page name="win" view-id="/win.jspx">
      <end-conversation/>
      <redirect/>
   </page>
  
   <page name="lose" view-id="/lose.jspx">
      <end-conversation/>
      <redirect/>
   </page>
  
</pageflow-definition>


当在页面上当我单击一个按钮:
    <h:commandButton id="GuessButton" value="Guess" action="guess"/>
就触发一个跳转,然后jbpm激活跳转action,当action对应的方法执行完后,转换完成进入到decision节点:对表达式进行判断,根据判断结果选择不同的调整页面

你可能感兴趣的:(xml,jboss,jbpm,seam)