<?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-1.0.xsd">

  <start-state idref="singleOrMultiple"/>

  <decision-state id="singleOrMultiple">
    <entry-actions>
      <action bean="blog.indexAction"/>
    </entry-actions>
    <if test="${flowScope.blogNum == 1}" then="singleView" else="multipleView"/>
  </decision-state>

  <end-state id="singleView" view="externalRedirect:/blog/${flowScope.blogs[0].code}/index.html"/>

  <end-state id="multipleView" view="blog.Index"/>

</flow>
