<?xml version="1.0" encoding="UTF-8"?>
<!--  Delft FEWS Published Interface (Copyright 2003 WL | Delft Hydraulics) -->
<schema xmlns:fews="http://www.wldelft.nl/fews/PI" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.wldelft.nl/fews/PI" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
	<include schemaLocation="pi_sharedtypes.xsd"/>
	<element name="TaskRuns" type="fews:TaskRunsComplexType">
		<annotation>
			<documentation>List of task runs.</documentation>
		</annotation>
	</element>
	<complexType name="TaskRunsComplexType">
		<sequence>
			<group ref="fews:TimeZoneChoice" minOccurs="0"/>
			<element name="taskRun" type="fews:TaskRunComplexType" minOccurs="0" maxOccurs="unbounded"/>
		</sequence>
		<attribute name="version" type="fews:versionString" use="required"/>
	</complexType>
	<complexType name="TaskRunComplexType">
		<sequence>
			<element name="forecast" type="boolean" minOccurs="1">
				<annotation>
					<documentation>Forecast task run or regular.</documentation>
				</annotation>
			</element>
			<element name="current" type="boolean" minOccurs="0">
				<annotation>
					<documentation>Forecast task run is current or not. Only applies to forecasts</documentation>
				</annotation>
			</element>
			<element name="status" type="fews:taskRunStatusEnumStringType" minOccurs="1">
				<annotation>
					<documentation>Status of run.</documentation>
				</annotation>
			</element>
			<element name="usedState" type="fews:usedStateEnumStringType" minOccurs="0">
				<annotation>
					<documentation>Type of state used by run.</documentation>
				</annotation>
			</element>
			<element name="workflowId" type="fews:idString" minOccurs="1">
				<annotation>
					<documentation>Workflow identifier of forecast task run.</documentation>
				</annotation>
			</element>
			<element name="dispatchTime" type="fews:DateTimeComplexType" minOccurs="0">
				<annotation>
					<documentation>Time of execution</documentation>
				</annotation>
			</element>
			<element name="completionTime" type="fews:DateTimeComplexType" minOccurs="0">
				<annotation>
					<documentation>Time task run completed</documentation>
				</annotation>
			</element>
			<element name="time0" type="fews:DateTimeComplexType">
				<annotation>
					<documentation>This is the start of a forecast for a forecast run.
						This is the time 0 of a FEWS task run.
					</documentation>
				</annotation>
			</element>
			<element name="outputStartTime" type="fews:DateTimeComplexType" minOccurs="0">
				<annotation>
					<documentation>Start time of output timeseries</documentation>
				</annotation>
			</element>
			<element name="outputEndTime" type="fews:DateTimeComplexType" minOccurs="0">
				<annotation>
					<documentation>End time of output timeseries</documentation>
				</annotation>
			</element>
			<element name="fssId" type="fews:idString" minOccurs="0">
				<annotation>
					<documentation>Identifier of shell server on which task was run</documentation>
				</annotation>
			</element>
			<element name="whatIfId" type="fews:idString" minOccurs="0">
				<annotation>
					<documentation>Optional: WhatIfScenario identifier used for run</documentation>
				</annotation>
			</element>
			<element name="user" type="fews:idString" minOccurs="0">
				<annotation>
					<documentation>Optional: Identifier of user that executed run</documentation>
				</annotation>
			</element>
			<element name="description" type="string" minOccurs="0">
				<annotation>
					<documentation>Descriptive text relating to taskrun</documentation>
				</annotation>
			</element>
		</sequence>
		<attribute name="taskRunId" type="fews:idString" use="required"/>
	</complexType>
	<simpleType name="taskRunStatusEnumStringType">
		<restriction base="string">
			<enumeration value="invalid"/>
			<enumeration value="pending"/>
			<enumeration value="terminated"/>
			<enumeration value="running"/>
			<enumeration value="failed"/>
			<enumeration value="completed fully successful"/>
			<enumeration value="completed partly successful"/>
			<enumeration value="approved"/>
			<enumeration value="approved partly successful"/>
			<enumeration value="amalgamated"/>
			<enumeration value="partly completed"/>
		</restriction>
	</simpleType>
	<simpleType name="usedStateEnumStringType">
		<restriction base="string">
			<enumeration value="coldstate">
				<annotation><documentation>Cold state selected and used</documentation></annotation>
			</enumeration>
			<enumeration value="missing warmstate">
				<annotation><documentation>Warm state selected but not found. Cold state used</documentation></annotation>
			</enumeration>
			<enumeration value="warmstate">
				<annotation><documentation>Warm state selected and used.</documentation></annotation>
			</enumeration>
			<enumeration value="missing default warmstate">
				<annotation><documentation>No state selected. Default warm state not found so default cold state used.</documentation></annotation>
			</enumeration>
			<enumeration value="default">
				<annotation><documentation>No state selected. Default state found and used. Can be either cold or warm</documentation></annotation>
			</enumeration>
			<enumeration value="backup warmstate">
				<annotation><documentation>Warm state selected but not found. Cold state used</documentation></annotation>
			</enumeration>
		</restriction>
	</simpleType>
</schema>