<?xml version="1.0" encoding="UTF-8"?>
<!--Delft FEWS (Copyright 2003 WL | Delft Hydraulics) -->
<schema targetNamespace="http://www.wldelft.nl/fews" xmlns:fews="http://www.wldelft.nl/fews" xmlns="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"
		version="1.0">
	<include schemaLocation="sharedTypes.xsd"/>
	<element name="floodPeriodsModule" type="fews:FloodPeriodsModuleComplexType"/>
	<!--    -->
	<complexType name="FloodPeriodsModuleComplexType">
		<sequence>
			<element name="newFloodPeriodLogEventCode" type="fews:nonEmptyStringType">
				<annotation>
					<documentation>Event code used for info message when new flood period is created</documentation>
				</annotation>
			</element>
			<element name="areaLocationAttributeId" type="fews:idStringType">
				<annotation>
					<documentation>To resolve the area of a location</documentation>
				</annotation>
			</element>
			<element name="skipLocationsWithoutAreaId" type="boolean">
				<annotation>
					<documentation>When true no error is logged when the configured areaLocationAttributeId is not available for a location</documentation>
				</annotation>
			</element>
			<element name="expiryTime" type="fews:CalendarTimeSpanComplexType">
				<annotation>
					<documentation>Expiry time of the generated flood periods</documentation>
				</annotation>
			</element>
			<element name="periodInitialLength" type="fews:TimeSpanComplexType">
				<annotation>
					<documentation>When a new period is created this is the minimum length, can be changed later by the user</documentation>
				</annotation>
			</element>
			<element name="maximumPeriodExtensionLength" type="fews:CalendarTimeSpanComplexType">
				<annotation>
					<documentation>A new flood period is created when the extension required to an existing provisional period is more than this length</documentation>
				</annotation>
			</element>
			<element name="forecastSearchPeriod" type="fews:RelativePeriodComplexType" minOccurs="0">
				<annotation>
					<documentation>All the forecasts in the time series sets and in this period are analysed</documentation>
				</annotation>
			</element>
			<element name="observed" type="fews:FloodPeriodThresholdCrossingsComplexType">
				<annotation>
					<documentation>Generate new flood periods when no flood period is available and extend open flood periods</documentation>
				</annotation>
			</element>
			<element name="forecasted" type="fews:FloodPeriodThresholdCrossingsComplexType">
				<annotation>
					<documentation>Generate new flood periods when no flood period is available and extend open flood periods</documentation>
				</annotation>
			</element>

		</sequence>
	</complexType>

	<!--    -->
	<complexType name="FloodPeriodThresholdCrossingsComplexType">
		<sequence>
			<element name="thresholdValuesSetsCrossings" type="fews:ThresholdValuesSetsCrossingsComplexType" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>Generate new flood periods when no flood period is available for the detected crossings in an area, base on the ThresholdValueSets.xml</documentation>
				</annotation>
			</element>
			<element name="importedThresholdCrossings" type="fews:ImportedThresholdCrossingsComplexType" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>Generate new flood periods when no flood period is available for the detected crossings in an area, base on an imported time series property</documentation>
				</annotation>
			</element>
		</sequence>
	</complexType>
	<!--    -->
	<complexType name="ThresholdValuesSetsCrossingsComplexType">
		<sequence>
			<element name="thresholdGroupId" type="fews:idStringType" minOccurs="0">
				<annotation>
					<documentation>When specified only the thresholds for the specified group are checked for crossings</documentation>
				</annotation>
			</element>
			<group ref="fews:TimeSeriesSetsGroup"/>
		</sequence>
	</complexType>
	<!--    -->
	<complexType name="ImportedThresholdCrossingsComplexType">
		<sequence>
			<element name="timeSeriesProperty" type="fews:ThresholdPropertyComplexType">
				<annotation>
					<documentation>When property with this key is detected a new period is started when not available yet</documentation>
				</annotation>
			</element>
			<group ref="fews:TimeSeriesSetsGroup"/>
		</sequence>
	</complexType>
	<!--    -->
	<complexType name="ThresholdPropertyComplexType">
		<sequence>
			<element name="map" type="fews:ThresholdPropertyValueMapComplexType" minOccurs="1" maxOccurs="unbounded"/>
		</sequence>
		<attribute name="key" type="fews:idStringType" use="required">
			<annotation>
				<documentation>When property with this key is detected a new period is started when not available yet</documentation>
			</annotation>
		</attribute>
	</complexType>
	<!--    -->
	<complexType name="ThresholdPropertyValueMapComplexType">
		<attribute name="value" type="string" use="required"/>
		<attribute name="thresholdId" type="fews:idStringType" use="required"/>
	</complexType>
</schema>
