Versions Compared

Key

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

...

Section
Column
width45%

Schema definition overview

The global structure of the XML-schema for the script configuration is shown on the right.

Anchor
titleScript
titleScript
The title key is an optional identifier for the script.

Anchor
timeZone
timeZone
The time zone for the Water Coach is specified within the section timeZone. All times in the script configuration must be specified relative to this time zone. The time zone can be specified as a name using the keyword name (e.g. GMT, MET, ...) or as an offset to the default time zone GMT using the keyword offset (e.g. +02:00, -06:00, ...).

Anchor
startstop
startstop
The start and end date/time for the script have to be specified using attributes date and time in the format YYYY-MM-DD and hh:mm:ss, respectively. The date/time of the data in the FEWS local data store does not have to match the date/time of the script. The actual date/time (or current system time) of the local data store can be specified with the key dataStart (if this key is not specified, dataStart is assumed to be equal to scriptStart). With this functionality, it is possible to play a scenario of several years ago as if it happened today.

The configuration of of stories  (events), the forecastTable,   forecastNote, and dictionaryFiles  dictionaryFilesfor a script are explained below.

Column

...

Section
Column
width45%

A condition can be based on components of the forecast table. It must be specified according to:

Anchor
condition
condition

  • Anchor
    columnId
    columnId
    columnId is a reference to a column in the forecast table (see below), usually a parameter,
  • Anchor
    rowId
    rowId
    rowId is a reference to a row in the forecast table (see below), usually a location,
  • Anchor
    ifForecastValue
    ifForecastValue
    ifForecastValue indicates a condition based on the value of the published forecast,
  • Anchor
    ifForecastPublicationTime
    ifForecastPublicationTime
    ifForecastPublicationTime indicates a condition based on the publication time of the forecast,
  • Anchor
    ifForecastPublished
    ifForecastPublished
    ifForecastPublished indicates a condition based on whether a forecast has been published or not,
  • Anchor
    operator
    operator
    operator is one of "lt" (less than), "gt" (greater than), "le" (less than or equal to), "ge" (greater than or equal to), "eq" (equal to), "ne" (not equal to), "before", or "after", depending on the type of condition,
  • value is the reference value to compare to; depending on the condition type, this can be an integer/real value, a boolean value, or a date/time value.

Anchor
script_configExample
script_configExample

An example in which conditions are used:

Code Block
xml
xml
<frame>
   <title>condition example</title>
   <start date="2008-03-13" time="00:01:00"/>
   <stop date="2008-03-13" time="00:02:00"/>
   <popup>true</popup>
   <condition>
      <columnId>water_level</columnId>
      <rowId>Lowestoft</rowId>
      <ifForecastPublished>
         <operator>eq</operator>
         <value>false</value>
      </ifForecastPublished>
   </condition>
   <message>Hurry, the forecast for Lowestoft has not been published yet!</message>
</frame>
<frame>
   <title>condition example</title>
   <start date="2008-03-13" time="00:10:00"/>
   <stop date="2008-03-13" time="00:11:00"/>
   <popup>true</popup>
   <condition>
      <columnId>water_level</columnId>
      <rowId>Lowestoft</rowId>
      <ifForecastPublicationTime>
         <operator>after</operator>
         <value date="2008-03-13" time="00:10:00"/>
      </ifForecastPublicationTime>
   </condition>
   <message>You were quite late with the forecast for Lowestoft</message>
</frame>
<frame>
   <title>condition example</title>
   <start date="2008-03-13" time="00:15:00"/>
   <stop date="2008-03-13" time="00:16:00"/>
   <popup>true</popup>
   <condition>
      <columnId>water_level</columnId>
      <rowId>Lowestoft</rowId>
      <ifForecastValue>
         <operator>ge</operator>
         <value>300</value>
      </ifForecastValue>
   </condition>
   <file>emergency_telephone_call.mp3</file>
</frame>
Column

...