Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


...

What

nameofinstance.xml

Required

no

Description

Export Log Messages (Threshold Events) from the Delft-Fews database to several file formats

schema location

http

https://

fews

fewsdocs.

wldelft

deltares.nl/schemas/version1.0/thresholdExport.xsd


Excerpt
hiddentrue

Exports threshold event log messages to several file formats

The thresholdExport module can be used to export threshold crossing log messages that have been created in a workflow with the threshold crossing module. The threshold crossing module will check time series against threshold values, and add records in the Delft-FEWS database with threshold crossing information. These threshold crossings can be exported to files in different formats. The threshold export module uses a template file that specifies the format of the exported file. The procedure how the elements in the template file are filled is similar to the report module.

Note: By design the threshold export module will only export threshold crossings that are created in the same workflow. It is therefore important to have one workflow that first logs the threshold crossings and then export these thresholds.

Configuration

The threshold export module can export threshold crossing events for use in other systems. The configuration of the module is split into several elements, information is provided below.

...

This type specifies which writer should be used to write the file. The type must be one from the enumeration. Presently (2017.01) Currently only CAP-AU is and CAP-EA are included in this list but they do not affect the outcome of the output just yet, which is fully determined by other config options and the mainly the template file.

folder

Folder (directory) in which to store the exported files.

...

  • %EXPORT_TIME(DF1)%: Will be replaced by the time the message is exported by FEWS. Time format is specified in the Export Module configuration file.
  • %MESSAGE_TYPE%: Enumeration: Alert, Update, Cancel. New alerts use Alert, then subsequent should use Update, and required references. For WL alerts we are assuming that the first threshold crossing should be Alert, and then subsequent threshold changes are updates (both up and down crossing), and a cancel is used when drops below lowest thresholds.
  • %ALERT_HISTORY (DF1)%: Include the history of the threshold exports within the configured eventExpiryTime period. Will be included in the CAP file as Reference element.
  • %THRESHOLD_NAME%: Will be the threshold name as configured in the Thresholds.xml file. When required a mapping table of Threshold ID’s from HyFS can be used.
  • %EXPIRY_TIME(DF1)%: Will be replaced by the time the message can expire, is general for all threshold exports and configurable in the Export Module configuration file.
  • %LOCATION_NAME%: Name of the location that crossed a threshold.
  • %THRESHOLD_VALUE%. Will be replaced by the threshold value that is crossed.
  • %THRESHOLD_MESSAGE%: Will be the complete threshold crossing message that is logged by HyFS.
  • %VALUE%. Will be replaced by the time series value that is logged to cross a threshold.
  • %X%,%Y%: Will be replaced by the X and Y coordinates of the location.
  • %CROSSING_DIRECTION%: Will be replaced by above or below is it is an up-crossing or down-crossing.

Example configuration file

...

Code Block
languagexml
titleExample threshold Export file
<thresholdExport 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/thresholdExport.xsd">
<export>
	<exportTypeStandard>CAP-AU</exportTypeStandard>
	<folder>$EXPORT_FOLDER$\CAP_Alerts</folder>
	<exportFileName>
		<name>_RiverAlert_CAP_%LOCATION_ID%_@STATE@_%THRESHOLD_ID%_.xml</name>
		<prefix>
			<timeZeroFormattingString>yyyyMMddHHmm</timeZeroFormattingString>
		</prefix>
		<suffix>
			<currentTimeFormattingString>yyyyMMddHHmmss</currentTimeFormattingString>
		</suffix>
	</exportFileName>
	<eventCodePattern>River_Alert.*</eventCodePattern>
	<eventCodePattern>River_Minor.*</eventCodePattern>
	<eventCodePattern>River_Moderate.*</eventCodePattern>
	<eventCodePattern>River_Major.*</eventCodePattern>
	<templateFile>CAP_Export_Template</templateFile>
	<dateFormat id="DF1">
		<timeZone>
			<timeZoneName>GMT</timeZoneName>
		</timeZone>
		<dateTimePattern>yyyy-MM-dd'T'HH:mm:ss+00:00</dateTimePattern>
	</dateFormat>
	<dateFormat id="DF2">
		<timeZone>
			<timeZoneName>ACST</timeZoneName>
		</timeZone>
		<dateTimePattern>dd-MM-yyyy</dateTimePattern>
	</dateFormat>
	<numberFormat id="NF1">
		<pattern>{0,number,##0.0}</pattern>
	</numberFormat>
	<filter>
		<parameterId>H.obs.proc</parameterId>
	</filter>
	<thresholdHistorySearchTimeSpan unit="day" multiplier="7"/>
	<eventExpiryTime unit="day" multiplier="1"/>
	<identifier>AusBoM-PRODUCT_ID-%LOCATION_ID%-%EXPORT_TIME(DF1)%</identifier>
	<sender>CAP.Message@bom.gov.au</sender>
	<mapThreshold thresholdId="River Alert" value="Unknown"/>
	<mapThreshold thresholdId="Minor Flooding" value="Minor"/>
	<mapThreshold thresholdId="Moderate Flooding" value="Moderate"/>
	<mapThreshold thresholdId="Major Flooding" value="Severe"/>
</export>
</thresholdExport>

Since 2023.01 it is possible to upload the xml to a url via basic authentication, by adding <serverUrl>, <connectionTimeOutMillis>, <user> and <password> or <encryptedPassword>

Code Block
languagexml
titleExample threshold export url upload config
	</exportFileName>
	<serverUrl>https://not.existing.url/nobody/listens/</serverUrl>
	<connectionTimeOutMillis>300000</connectionTimeOutMillis>
	<user>MeYouAndEveryoneWeKnow</user>
	<encryptedPassword>g!u@e#s$s%W^h&a*t</encryptedPassword>
	<eventCodePattern>River_Minor.*</eventCodePattern>


Code Block
languagexml
titleExample Template File
<alert xmlns="urn:oasis:names:tc:emergency:cap:1.2">
	<identifier>%IDENTIFIER%</identifier>
	<sender>%SENDER%</sender>
	<sent>%EXPORT_TIME(DF1)%</sent>
	<status>Actual</status>
	<msgType>%MESSAGE_TYPE%</msgType>
	<source>@STATE@, STATE_AGENCY</source>
	<scope>Public</scope>
	<code>urn:oasis:names:tc:emergency:cap:1.2:profile:CAP-AU:1.0</code>
	%ALERT_HISTORY(DF1)%
	<info>
		<language>en-AU</language>
		<category>Met</category>
		<event>EVENT_EVENT</event>
		<urgency>Unknown</urgency>
		<severity>%SEVERITY%</severity>
		<certainty>Observed</certainty>
		<eventCode>
			<valueName>https://govshare.gov.au/xmlui/handle/10772/6495</valueName>
			<value>EVENTCODE</value>
		</eventCode>
		<expires>%EXPIRY_TIME(DF1)%</expires>
		<senderName>Australian Government</senderName>
		<headline>%MESSAGE_TYPE%: River Alert at %LOCATION_NAME% %CROSSING_DIRECTION% %THRESHOLD_NAME% level at %CROSSING_TIME(DF1)% - %THRESHOLD_VALUE(NF1)%  Value: %VALUE(NF1)% (@STATE@)</headline>
		<description>%THRESHOLD_MESSAGE%</description>
		<contact>http://www.bom.gov.au/inside/contacts.shtml</contact>
		<area>
			<areaDesc>%LOCATION_NAME% (RIVER_NAME) - @STATE@</areaDesc>
			<circle>%Y%,%X% 1</circle>
			<geocode>
				<valueName>http://www.iso.org/iso/country_codes.html</valueName>
				<value>AU-@STATE@</value>
			</geocode>
		</area>
	</info>
</alert>


Multivalued

...

Attribute Tags (since 2019.02)


Since 2019.02 it is possible to define custom tags that will be replaced in the template by multivalued attributes.

The multivalued index will be found by matching the threshold event value with the value of specific multivalued matching attribute value.

Also different attributes can be used for up and down crossings.

When a tag needs to be replaced with text that is larger than 255 characters, it should be split into multiple tags because the maximum length of a text attribute value is 255.

Code Block
languagexml
titleExample Template File
<matchingValueAttributeId>ruleOutcome</matchingValueAttributeId>
<multiValuedAttributeTag>
   <tag>MVT_SEVERITY</tag>
   <upCrossingAttributeId>severity</upCrossingAttributeId>
   <downCrossingAttributeId>downSeverity</downCrossingAttributeId>
</multiValuedAttributeTag>
<multiValuedAttributeTag>
   <tag>MVT_CERTAINTY</tag>
   <upCrossingAttributeId>certainty</upCrossingAttributeId>
   <downCrossingAttributeId>downCertainty</downCrossingAttributeId>
</multiValuedAttributeTag>
<multiValuedAttributeTag>
   <tag>MVT_DESCRIPTION_1</tag>
   <upCrossingAttributeId>description1</upCrossingAttributeId>
   <downCrossingAttributeId>downDescription1</downCrossingAttributeId>
</multiValuedAttributeTag>
<multiValuedAttributeTag>
   <tag>MVT_DESCRIPTION_2</tag>
   <upCrossingAttributeId>description2</upCrossingAttributeId>
   <downCrossingAttributeId>downDescription2</downCrossingAttributeId>
</multiValuedAttributeTag>

...