<?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"
    parent="searchItems"
    start-state="chooseState">

    <decision-state id="chooseState">
        <if test="conversationScope.searchTemplate == null || conversationScope.searchTemplate.searchCriteria == null"
            then="loadDomainSearch" 
            else="search" />
    </decision-state>       
         
    <action-state id="loadDomainSearch">
        <evaluate expression="springWebFlowActionAdapter">
            <attribute
                name="actionName"
                value="search" />
            <attribute
                name="actionMethod"
                value="loadDomainSearch" />
        </evaluate>
        <transition
            on="success"
            to="searchCriteria" />
    </action-state>

</flow>