<?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="init"/>

  <action-state id="init">
    <action bean="blog.entryCreateAction" method="init"/>
    <transition on="success" to="form"/>
  </action-state>

  <subflow-state flow="message/form-sub-flow" id="form">
    <attribute-mapper>
      <input-mapper>
        <input-attribute name="pageTitleCode" required="true"/>
        <input-attribute name="formSubmitCode" required="true"/>
        <input-attribute name="subjectRequired" required="true"/>
      </input-mapper>
      <output-mapper>
        <output-attribute name="message" required="true"/>
      </output-mapper>
    </attribute-mapper>
    <transition on="finish" to="store"/>
  </subflow-state>

  <action-state id="store">
    <action bean="blog.entryCreateAction" method="post"/>
    <transition on="success" to="finish"/>
  </action-state>

  <end-state id="finish" view="externalRedirect:/blog/${flowScope.blogCode}/index.html"/>

</flow>
