SelectDataSource

Input
  • inputVariableDefinition ( 1 or more input time series)
Options
  • attributeFunctionId
Output
  • outputVariable
Description

This transformation can be used to select an input time series from a set of input time series and copy that to the output time series. The selection will be done by using the attributeFunctionId.

The attributeFunctionId will reference the value of the attribute for the current output location. The value of this attribute will be matched against the variableId of the input timeseries. 

The following example will explain this in more detail. Lets say we are running this transformation for outputLocation outputA and attributeFunctionId is set to attributeA. In addition there are 2 input time series configured:inputA and inputB. InputA is referenced by variableId inputA and inputB is referenced by the variableId inputB. To determine which of two input time series will be copied to the output time series the transformation will first determine the value of attribute attributeA of outputLocation outputA. Lets assume that in our example the value is inputB. The transformation will then try to match the variable ids of the input time series against the value of the attribute attributeA. The value of the attribute is inputB which matches against the variable id of input time series B. The result will be in this case that input time series B will be copied to the output time series.

Configuration example
<?xml version="1.0" encoding="UTF-8"?>
<transformationModule version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
					  xmlns="http://www.wldelft.nl/fews"
					  xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/transformationModule.xsd">
	<variable>
		<variableId>inputA</variableId>
		<timeSeriesSet>
			<moduleInstanceId>SelectLocationFunctionTest</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>H.m</parameterId>
			<locationSetId>MergeTest1</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="day"/>
			<relativeViewPeriod unit="day" start="0" end="30"/>
			<readWriteMode>editing visible to all future task runs</readWriteMode>
		</timeSeriesSet>
	</variable>
	<variable>
		<variableId>inputB</variableId>
		<timeSeriesSet>
			<moduleInstanceId>SelectLocationFunctionTest</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>H.m</parameterId>
			<locationSetId>MergeTest2</locationSetId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="day"/>
			<relativeViewPeriod unit="day" start="0" end="30"/>
			<readWriteMode>editing visible to all future task runs</readWriteMode>
		</timeSeriesSet>
	</variable>
	<transformation id="example">
		<merge>
			<selectDataSource>
				<input>
					<variableId>inputA</variableId>
				</input>
				<input>
					<variableId>inputB</variableId>
				</input>
				<attributeFunctionId>@attributeA@</attributeFunctionId>
				<output>
					<timeSeriesSet>
						<moduleInstanceId>SelectLocationFunctionTest</moduleInstanceId>
						<valueType>scalar</valueType>
						<parameterId>Q.m</parameterId>
						<locationSetId>MergeTest2</locationSetId>
						<timeSeriesType>external historical</timeSeriesType>
						<timeStep unit="day"/>
						<relativeViewPeriod unit="day" start="0" end="30"/>
						<readWriteMode>add originals</readWriteMode>
					</timeSeriesSet>
				</output>
			</selectDataSource>
		</merge>
	</transformation>
</transformationModule>

  • No labels