Description

This transformation determines if one of the configured conditions is valid, if this is the case the ruleIndex which identifies this conditions is written to the output Time Series. Condition operation options include: eq (equal), ge (great or equal than), gt (great than), le (less or equal than), lt (less than), ne (not equal). It is possible to create a single rule or a ruleGroup in ruleCriteria.

Input

output

optional elements

xsd definition

<complexType name="CriticalConditionalLookupTransformationComplexType">
		<annotation>
			<documentation>if a default value cannot be found in the rules criteria, an output value is searched in the lookup table</documentation>
		</annotation>
		<complexContent>
			<extension base="fews:FunctionBaseComplexType">
				<sequence>
					<element name="inputVariableDefinition" type="fews:InputVariableExpressionBasedFunctionComplexType" minOccurs="0" maxOccurs="unbounded">
						<annotation>
							<documentation>Definitions of variables that can be used as input in this transformation. A variable is always a time series. Alternatively variables can be defined at the start of this transformations file.</documentation>
						</annotation>
					</element>
					<element name="criticalConditionLookup" type="fews:CriticalConditionLookUpComplexType"/>
					<element name="defaultValue" type="fews:RuleCriteriasComplexType" minOccurs="0"/>
					<element name="outputVariable" type="fews:OutputVariableComplexType"/>
					<element name="reportAllConditions" type="boolean" minOccurs="0">
						<annotation>
							<documentation>Optional element to disable reporting of all conditions. Default is true. Set to false to disable warnings. </documentation>
						</annotation>
					</element>
					<element name="className" type="fews:nameStringType" default="nl.wldelft.fews.system.plugin.transformationmodule.function.implementation.lookup.CriticalConditionalLookupFunction" minOccurs="0">
						<annotation>
							<documentation>Optional element to define the name of the class that should be executed to perform this transformation. Normally this element can be left out of the xml configuration, and the default class name will be used. This default class name is defined as the default value for this element in the xsd schema for this transformation. Only use this element if you need to use a custom class that is present in the program code.</documentation>
						</annotation>
					</element>
				</sequence>
			</extension>
		</complexContent>
	</complexType>

configuration example

<?xml version="1.0" encoding="UTF-8"?>
<transformationModule version="1.0" xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/transformationModule.xsd">
	<!--Input time series-->
	<variable>
		<variableId>Q_in</variableId>
		<timeSeriesSet>
			<moduleInstanceId>ImportDatabase</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>Q.obs</parameterId>
			<locationSetId>HydroGauges_HuangChuan</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant"/>
			<relativeViewPeriod unit="day" start="-16" end="0" startOverrulable="true"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</variable>
	<!--Output time series-->
	<variable>
		<variableId>Q_out</variableId>
		<timeSeriesSet>
			<moduleInstanceId>HuangChuan_Update_Pre</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>Q.obs</parameterId>
			<locationSetId>HydroGauges_HuangChuan</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="nonequidistant"/>
			<!--<timeStep unit="hour" multiplier="6"/>-->
			<relativeViewPeriod unit="day" start="-16" end="0" startOverrulable="true"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</variable>
	<!--Transformations-->
	<transformation id="conditional">
		<conditional>
			<multiple>
				<criticalConditionLookup>
					<criticalCondition rule="INFO" ruleIndex="0">
						<ruleCriteria>
							<rule variable="Q_in" value="1000" operator="lt"/>
						</ruleCriteria>
					</criticalCondition>
					<criticalCondition rule="WARN" ruleIndex="-1">
						<ruleCriteria>
							<rule variable="Q_in" value="1000" operator="ge"/>
						</ruleCriteria>
					</criticalCondition>
				</criticalConditionLookup>
				<defaultValue rule="2" ruleIndex="2">			<!-- Optional -->
					<ruleCriteria>
						<rule variable="H1" value="1" operator="ge" logical="and"></rule>
						<rule variable="H1" value="11" operator="lt" ></rule>
					</ruleCriteria>
				</defaultValue>
			    <outputVariable>
					<variableId>Q_out</variableId>
				</outputVariable>
				<reportAllConditions>true</reportAllConditions>  <!-- Optional -->
    		</multiple>
		</conditional>
	</transformation>
</transformationModule>