Versions Compared

Key

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

...

Firstly to trigger the threshold crossing module, it is necessary to include the predefinedActivity "threshold event crossing" in a workflow. When the threshold crossing module runs it will look at the configured timeseriesset in the ThresholdValueSets file and check if any data was written to these timeseries. Timeseries are only checked for threshold crossings if the data values have changed. For external timeseries it is possible to skip the check for changes and always check for threshold crossings. This can be configured with option 'onlyCheckThresholdsOfChangedSeries' in the workflow descriptor file.

 Once Once a threshold crossing check has been triggered the threshold event is logged in the database. Depending on issue status and event coupling, a message will appear in the log panel at a certain log level. The logging process works as follows:

0) On initialization of the Threshold Crossing Module a subset of events is read from the ThresholdEventsTable. The number of records read is defined by the configuration parameter 'maxActionEventDuraion' times 10. Events older than this are considered irrelevant.

1) Check if  a if a newly logged event is already in the list of logged events retrieved from the database. For this check the following values are compared in the given order:

Code Block
check threshold type
check threshold direction
check time series type 
check event time
check event value. Difference has aan allowed tolerance of 10% of value.
For forecasted timeseries check the taskrunid
check moduleInstanceId
check thresholdValueSetId
check thresholdId
check locationId
check parameterId
check eventActionId
check rateOfChange value

...

   At the end of this action we have a list of all currently active Action Events. Threshold crossings for which no Action Event is configured in a 'LocationThresholds.csv' will not appear at WARN level in the log panel.

5) Go over the list of currently active Action Events and check if they have exceeded their max action duration time. This is the maximum time that an action event can be active. This value is configured in the Thresholds file with element 'maxActionEventDuration'. Default value is 1 Day. If an up action has expired then a corresponding down Action Event needs to be created and added to the issue list. Action Events of none approved forecast timeseries are skipped.

...

Anchor
thresholdeventcrossing
thresholdeventcrossing
Run ThresholdEventCrossing module in workflow

Run Threshold Event Crossing module in workflow

...

The ThresholdEventCrossing module is replaced in 2013 by a predefined activity. This predefined activity has the same functionality as the old ThresholdEvent module. You can add the following predefined activity to your workflowDefine module in the ModuleDescriptors.xml file (obsolete since 2013.02):

Code Block
languagexml
titleModuleDescriptorsworkflow.xml (obsolete since 2013.02)
<moduleDescriptor id="ThresholdChecks">
    <description>Module to check on threshold event crossings</description>
	<className>nl.wldelft.fews.system.plugin.threshold.ThresholdEventCrossingModule</className>
</moduleDescriptor>
<activity>
	<runIndependent>false</runIndependent>
	<predefinedActivity>threshold event crossing</predefinedActivity>
 </activity>	

 Do make sure to set the relativeViewPeriod correctly in ThresholdValueSets.xmlCreate entry in ModuleInstanceDescriptors.xml file:

Code Block
languagexml
titleModuleInstanceDescriptorsthresholdvaluesets.xml
<moduleInstanceDescriptor<timeSeriesSet>
	<moduleInstanceId>ImportCSV</moduleInstanceId>
	<valueType>scalar</valueType>
	<parameterId>H.obs</parameterId>
	<locationId>Bhadra_Reservoir</locationId>
	<timeSeriesType>external historical</timeSeriesType>
	<timeStep id="ThresholdChecksdaily0600"/>
	<moduleId>ThresholdChecks</moduleId>
</moduleInstanceDescriptor>

Add the module to the workflow. Please note:

  • The module will take all external time series into account (external historical and external forecast series created inside and outside the workflow) and only simulated (simulated historical, simulated forecasting) time series which are created within the same workflow.
  • When the module should also only check external time series changed within the current workflow, the attribute "onlyCheckThresholdsOfChangedSeries" in the workflow descriptor file need to be set to true.
  • The module needs to be added at the end of the workflow where the timeseries have been created (e.g. imported or by transformation).
  • The relativeViewPeriod configured for the timeseriesSets in the ThresholdValueSets.xml determines the viewPeriod for which thresholdcrossings are determined. If the timeseries that has been imported or otherwise created is longer than the configured relative view period, the values outside this relativeViewPeriod will not be validated.
  • As a result, the threshold crossing logs are written to the database, and can for example be used in eventActions and shown in the system wide threshold events display.
  • When time series from within a threshold value set should not be taken into account, do not use a <relativeViewPeriod> for them and not a <readWriteMode> that says "read complete forecast".

Run Threshold Event Crossing activity in workflow (2013.02 and later):

The ThresholdEventCrossing module is replaced by a predefined activity. This predefined activity has the same functionality as the old ThresholdEvent module. You can add the following predefined activity to your workflow:

Code Block
languagexml
titleworkflow.xml
<activity>
	<runIndependent>false</runIndependent>
	<predefinedActivity>threshold event crossing</predefinedActivity>
 </activity>	

 Do make sure to set the relativeViewPeriod correctly in ThresholdValueSets.xml:

Code Block
languagexml
titlethresholdvaluesets.xml
<timeSeriesSet>
	<moduleInstanceId>ImportCSV</moduleInstanceId>
	<valueType>scalar</valueType>
	<parameterId>H.obs</parameterId>
	<locationId>Bhadra_Reservoir</locationId>
	<timeSeriesType>external historical</timeSeriesType>
	<timeStep id="daily0600"/>
	<relativeViewPeriod unit="day" start="-365" end="0"/>
	<readWriteMode>add originals</readWriteMode>
</timeSeriesSet>

For the threshold event values to be visible in the ThresholdEvents display the view period needs to be set:

Code Block
languagexml
titlethresholdvaluesets.xml
<eventTimeViewPeriod start="-365" end="48" unit="day"/>

...

<relativeViewPeriod unit="day" start="-5" end="0"/>
	<readWriteMode>read only</readWriteMode>
</timeSeriesSet>

For the threshold event values to be visible in the ThresholdEvents display the view period needs to be set:

Code Block
languagexml
titlethresholdvaluesets.xml
<eventTimeViewPeriod start="-365" end="48" unit="day"/>

If this is not done it will default to -10 day to +10 days. This does not have to be a problem because it is always possible to overrule the view period in the display itself by mean of filtering: double-click 'Event Time' column and a pop-up will appear where the user can set the period for viewing threshold events.

When the predefined activity is added to the workflow. Please note:

  • The module will take all external time series into account (external historical and external forecast series created inside and outside the workflow) and only simulated (simulated historical, simulated forecasting) time series which are created within the same workflow.
  • When the module should only check external time series changed within the current workflow, the attribute "onlyCheckThresholdsOfChangedSeries" in the workflow descriptor file need to be set to true. This need to be added to all workflowdescriptors that have the threshold crossing module included.
  • The module needs to be added at the end of the workflow where the timeseries have been created (e.g. imported or by transformation).
  • The relativeViewPeriod configured for the timeseriesSets in the ThresholdValueSets.xml determines the viewPeriod for which thresholdcrossings are determined. If the timeseries that has been imported or otherwise created is longer than the configured relative view period, the values outside this relativeViewPeriod will not be validated.
  • As a result, the threshold crossing logs are written to the database, and can for example be used in eventActions and shown in the system wide threshold events display.
  • When time series from within a threshold value set should not be taken into account, do not use a <relativeViewPeriod> for them and not a <readWriteMode> that says "read complete forecast".


Seasonal Thresholds

Since 2018.02 thresholds can be made seasonal if a threshold is only valid for part of a year. When not configured the threshold is valid for the entire year.

...