<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema
	xmlns="http://www.springframework.org/schema/webflow-config"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:beans="http://www.springframework.org/schema/beans"
	targetNamespace="http://www.springframework.org/schema/webflow-config"
	elementFormDefault="qualified" attributeFormDefault="unqualified"
	version="2.0.3">
	
	<xsd:annotation>
		<xsd:documentation>
			<![CDATA[
Spring Web Flow Configuration Schema
Authors: Keith Donald, Jeremy Grelle, Scott Andrews
<br>
A XML-based DSL for configuring the Spring Web Flow 2.0 system.
]]>
		</xsd:documentation>
	</xsd:annotation>

	<xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" />

	<xsd:element name="flow-registry">
		<xsd:annotation>
			<xsd:documentation>
				<![CDATA[
Deploys a registry of flow definitions.  A flow registry is used by a flow executor to locate flows to execute.
<br>
Each flow definition registered in this registry is assigned a unique identifier. By default,
this identifier is the name of the externalized resource minus its file extension.  For example,
a registry containing flow definitions built from the files "orderitem-flow.xml" and "shipping-flow.xml"
would index those definitions by "orderitem-flow" and "shipping-flow" by default.
]]>
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="beans:identifiedType">
					<xsd:choice minOccurs="0" maxOccurs="unbounded">		
						<xsd:element name="flow-location" type="flowLocationType">
							<xsd:annotation>
								<xsd:documentation>
									<![CDATA[
Registers a flow defined at an external resource such as a .xml file.
]]>
								</xsd:documentation>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="flow-location-pattern">
							<xsd:annotation>
								<xsd:documentation>
									<![CDATA[
Registers a set of flows resolved from a resource location pattern (e.g. /WEB-INF/flows/**/*-flow.xml).
]]>
								</xsd:documentation>
							</xsd:annotation>
							<xsd:complexType>						
								<xsd:attribute name="value" type="xsd:string" use="required">
									<xsd:annotation>
										<xsd:documentation>
											<![CDATA[
The location pattern to resolve (e.g. /WEB-INF/flows/**/*-flow.xml)
]]>
										</xsd:documentation>
									</xsd:annotation>
								</xsd:attribute>
							</xsd:complexType>
						</xsd:element>
						<xsd:element name="flow-builder" type="flowBuilderType">
							<xsd:annotation>
								<xsd:documentation>
									<![CDATA[
Registers a custom FlowBuilder implementation.
]]>
								</xsd:documentation>
							</xsd:annotation>
						</xsd:element>												
					</xsd:choice>
					<xsd:attribute name="flow-builder-services" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
								<![CDATA[
A reference to a FlowBuilderServices implementation defining custom services needed to build the flows registered in this registry.
Optional.  For use when one or more custom builder services are required.
]]>
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="parent" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
								<![CDATA[
A reference to this registry's parent.  Registries can be organized in a hierarchy.  If a child registry does not contain a flow,
its parent registry will be queried.
]]>
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="base-path" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
								<![CDATA[
The base path where flow definitions are found.  When specified, all flow locations are relative to this path.
Also when specified, by default flows are assigned ids equal to the the path segment between their base path and file name.
For example, if a flow definition is located at '/WEB-INF/hotels/booking/booking-flow.xml' and the base path is '/WEB-INF', 
the remaining path to this flow is 'hotels/booking' which then becomes the flow id.
If a flow definition is found directly on the base path, the file name minus its extension is used as the flow id. 
]]>
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="flowLocationType">
		<xsd:sequence>
			<xsd:element name="flow-definition-attributes" type="flowDefinitionAttributesType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>
						<![CDATA[
Meta-attributes to assign to the flow definition.
]]>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>	
		<xsd:attribute name="id" type="xsd:string">
			<xsd:annotation>
				<xsd:documentation>
					<![CDATA[
The id assign the flow definition in this registry.  Optional.
Specify when you wish to provide a custom flow definition identifier.
When specified, the id must be unique among all flows in this registry.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="path" type="xsd:string" use="required">
			<xsd:annotation>
				<xsd:documentation>
					<![CDATA[
The resource path to the externalized flow definition resource. May be a path to a single resource or a ANT-style path expression
that matches multiple resources.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

	<xsd:complexType name="flowBuilderType">
		<xsd:sequence>
			<xsd:element name="flow-definition-attributes" type="flowDefinitionAttributesType" minOccurs="0">
				<xsd:annotation>
					<xsd:documentation>
						<![CDATA[
Attributes to assign to the flow definition.
]]>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>	
		<xsd:attribute name="id" type="xsd:string">
			<xsd:annotation>
				<xsd:documentation>
					<![CDATA[
The id assign the flow definition in this registry.  Optional.
Specify when you wish to provide a custom flow definition identifier.
When specified, the id must be unique among all flows in this registry.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>	
		<xsd:attribute name="class" type="xsd:string" use="required">
			<xsd:annotation>
				<xsd:documentation>
				<![CDATA[
The fully qualified class name of the FlowBuilder implementation.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

	<xsd:element name="flow-builder-services">
		<xsd:annotation>
			<xsd:documentation>
				<![CDATA[
Registers custom implementations of services needed to build flow definitions.
With this tag, you may configure a custom ConversionService, FormatterFactory, ExpressionParser, and ViewFactoryCreator implementation.
This tag is only needed when you wish to plugin custom implementations.
]]>	
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="beans:identifiedType">
					<xsd:attribute name="conversion-service">
						<xsd:annotation>
							<xsd:documentation>
								<![CDATA[
The custom ConversionService implementation to use to convert from one type to another.
]]>
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="expression-parser">
						<xsd:annotation>
							<xsd:documentation>
								<![CDATA[
The custom ExpressionParser implementation to use to compile expression strings into Expressions.
]]>
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="view-factory-creator">
						<xsd:annotation>
							<xsd:documentation>
								<![CDATA[
The custom ViewFactoryCreator implementation to use produce ViewFactories capable of rendering Views.
]]>
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="development" type="xsd:boolean">
						<xsd:annotation>
							<xsd:documentation>
								<![CDATA[
Puts all flows in development mode.
When set to true, changes to a flow definition will be auto-detected and will result in a flow refresh.
]]>
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
			
	<xsd:element name="flow-executor">
		<xsd:annotation>
			<xsd:documentation>
				<![CDATA[
Deploys a flow executor.  A FlowExecutor executes flow definitions and acts as the entry-point into the Web Flow system.
A flow executor launches new flow executions and resumes paused flow executions.
Paused flow executions are stored between requests in a FlowExecutionRepository.
]]>
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="beans:identifiedType">
					<xsd:choice maxOccurs="unbounded">
						<xsd:element name="flow-execution-repository" type="flowExecutionRepositoryType" minOccurs="0">
							<xsd:annotation>
								<xsd:documentation>
									<![CDATA[
Configures the FlowExecutionRepository used by this executor to persist flow executions.
Specify when you want to tune the attributes of the default repository implementation.
]]>
								</xsd:documentation>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="flow-execution-attributes" type="flowExecutionAttributesType" minOccurs="0">
							<xsd:annotation>
								<xsd:documentation>
									<![CDATA[
Meta attributes to assign new flow executions launched by this executor.  These attributes will be associated with all flow executions, 
regardless of their underlying flow definition. Such attributes may influence flow execution behavior at runtime.
]]>
								</xsd:documentation>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="flow-execution-listeners" type="flowExecutionListenersType" minOccurs="0">
							<xsd:annotation>
								<xsd:documentation>
									<![CDATA[
Registers listeners that observe the lifecycle of flow executions launched by this executor.
]]>
								</xsd:documentation>
							</xsd:annotation>
						</xsd:element>
					</xsd:choice>
					<xsd:attribute name="flow-registry" type="xsd:string" default="flowRegistry">
						<xsd:annotation>
							<xsd:documentation>
								<![CDATA[
A reference to the FlowRegistry bean containing the flows eligible for execution by this executor.
The default value 'flowRegistry'.
]]>
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
	
	<xsd:complexType name="flowExecutionRepositoryType">
		<xsd:attribute name="max-executions" type="xsd:integer">
			<xsd:annotation>
				<xsd:documentation>
				<![CDATA[
The maximum number of persistent flow executions allowed per user session.  The default is 5.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="max-execution-snapshots" type="xsd:integer">
			<xsd:annotation>
				<xsd:documentation>
				<![CDATA[
The maximum number of history snapshots allowed per flow execution.  The default is 30.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

	<xsd:complexType name="flowExecutionListenersType">
		<xsd:sequence>
			<xsd:element name="listener" type="flowExecutionListenerType" maxOccurs="unbounded">
				<xsd:annotation>
					<xsd:documentation>
						<![CDATA[
Registers a listener to observe the execution lifecycle of one or more flows.
The flow definitions this listener observes may be restricted by specifying listener criteria.
]]>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="flowExecutionListenerType">
		<xsd:attribute name="ref" type="xsd:string" use="required">
			<xsd:annotation>
				<xsd:documentation>
					<![CDATA[
A reference to the flow execution listener implementation to register.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="criteria" type="xsd:string" default="*">
			<xsd:annotation>
				<xsd:documentation>
					<![CDATA[
The criteria that determines the flow definitions your listener should observe, delimited by commas or '*' for "all".
Example: 'flow1,flow2,flow3'.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

	<xsd:complexType name="flowExecutionAttributesType">
		<xsd:sequence>
			<xsd:element name="always-redirect-on-pause" type="alwaysRedirectOnPauseType" minOccurs="0" maxOccurs="1">
				<xsd:annotation>
					<xsd:documentation>
						<![CDATA[
Determines if flow executions always redirect after they pause.
]]>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
			<xsd:element name="attribute" type="attributeType" minOccurs="0" maxOccurs="unbounded">
				<xsd:annotation>
					<xsd:documentation>
						<![CDATA[
A single flow execution meta attribute.
]]>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="alwaysRedirectOnPauseType">
		<xsd:attribute name="value" type="xsd:boolean" use="required">
			<xsd:annotation>
				<xsd:documentation>
					<![CDATA[
true = always redirect on pause; false = do not, only redirect when explicitly instructed by the flow definition.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

	<xsd:complexType name="flowDefinitionAttributesType">
		<xsd:sequence>
			<xsd:element name="attribute" type="attributeType" minOccurs="0" maxOccurs="unbounded">
				<xsd:annotation>
					<xsd:documentation>
						<![CDATA[
A single flow definition meta attribute.
]]>
					</xsd:documentation>
				</xsd:annotation>
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
	
	<xsd:complexType name="attributeType">
		<xsd:attribute name="name" type="xsd:string" use="required">
			<xsd:annotation>
				<xsd:documentation>
					<![CDATA[
The name of the attribute.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="type" type="xsd:string" use="optional">
			<xsd:annotation>
				<xsd:documentation>
					<![CDATA[
The attribute's type, used to perform a from-string type conversion if specified.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
		<xsd:attribute name="value" type="xsd:string" use="required">
			<xsd:annotation>
				<xsd:documentation>
					<![CDATA[
The attribute value, subject to a type conversion if the 'type' attribute is defined.
]]>
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

</xsd:schema>