...
A condition
can be added to a story (or inbox) frame; the associated event will only be executed if this condition is fulfilled. For now, the only supported condition is one conditions can only based on a forecast published by the user. A condition must be specified according to:
...
columnId
is a reference to a column in the forecast table (see below), usually a parameter,rowId
is a reference to a row in the forecast table (see below), usually a location,ifForecastValue
indicates a condition based on the value of the published forecast,ifForecastPublicationTime
indicates a condition based on the publication time of the forecast,ifForecastPublished
indicates a condition based on whether a forecast has been published or not,operator
is one of "lt" (less than), "gt" (greater than), "le" (less than or equal to), or "ge" (greater than or equal to), and"eq" (equal to), "ne" (not equal to), "before", or "after", depending on the type of condition,value
value
is the reference value to compare to.
An example in which a condition is used:
- ; depending on the condition type, this can be an integer value, a boolean value, or a date/time value.
An example in which conditions are used:
Code Block | ||||
---|---|---|---|---|
| ||||
<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> | ||||
Code Block | ||||
xml | xml | <frame> <title>condition example</title> <start date="2008-03-13" time="00:0115:00"/> <stop date="2008-03-13" time="00:0216:00"/> <popup>true</popup> <condition> <type>forecast<<columnId>water_level</type>columnId> <columnId>water_level<<rowId>Lowestoft</columnId>rowId> <rowId>Lowestoft</rowId><ifForecastValue> <operator>ge</operator> <value>300</value> </ifForecastValue> </condition> <file>emergency_telephone_call.txt</file> </frame> |
...