The editor is used to enter freeform or SQL text or to edit the default HTML email template.
The text editor is used to:
- Specify text to be included in a plain text email in an Action List. The editor is displayed when you click
in the Email body field.
- Edit the standard HTML and specific InfoWorks ICM elements when configuring an HTML email in an Action List. The editor is displayed by clicking
in the HTML template field.
- Define expressions for alert definitions in an Alert Definition List. The editor is displayed when you click
in the Target expression A field.
- Insert SQL queries for alert definitions in an Alert Definition List. The editor is displayed when you
in the Target SQL prefix A field or the Target SQL body A field.
Email body dialog
Specify the text that will be displayed in the body of the email that will be sent, and click OK to save the changes and close the dialog.
HTML template dialog
Edit the default HTML and specific InfoWorks ICM elements (described in Action Lists), if required, for the email that will be sent when an action is triggered. Click OK to save the changes and close the dialog.
Target expression A dialog
Type in the desired expression and click OK to save the changes and close the dialog.
A valid expression can contain the following characters: “AND”, “OR”, “(“, “)”, “NOT” and the $ sign should prefix any alert definition ID, e.g.
Alert1 AND $Alert2
$Rainfall1 OR $Rainfall2 OR $Rainfall3
Target SQL prefix A Dialog
Type in the desired SQL query and click OK to save the changes and close the dialog.
Example
Below is an example illustrating how results/attributes from one object type can be compared against the results/attributes of any other. The FROM clause is only required where the SQL query in the prefix refers to a different object type from that referred to in the main SQL body. See Note below.
Let us consider an alert definition based on all nodes (Target type A set to Node and Target A set to <ALL>) with the following SQL query in the Target SQL prefix A dialog:
SELECT sim.us_depth INTO $var FROM [Conduit] WHERE oid = '44623701.1'
This takes the us_depth simulation result from the 44623701.1 conduit and inserts it into the $var SQL variable for use in the main SQL body (see below).
It is highly recommended to build SQL queries first in the SQL dialog before pasting them into this dialog.
Target SQL body A dialog
Type in the desired SQL query and click OK to save the changes and close the dialog.
Example
If we take the example started above and type in the following SQL in the Target SQL body A dialog:
(sim.depnod + $var) > 10.66
This means that an alert will be raised whenever the sum of any node depnod simulation result and the value of $var is greater than 10.66.
It is highly recommended to build SQL queries first in the SQL dialog before pasting them into this dialog.
To alert on the maximum depth for a particular river reach, where the river reach is specified in Target A, type in the following SQL in the Target SQL body A dialog:
MAX(sim.river_section.rr_depth)>2.0
To alert on the maximum flow for a particular river section within a particular river reach, where the river reach is specified in Target A, type in the following SQL in the Target SQL body A dialog:
MAX(IIF(river_section.key='XS358',sim.river_section.rr_flow,NULL))>75.0
Note about flexible targeting of Target B
If the Target type B and Target B fields are left blank for an SQL-based alert, any generated alert instance will automatically inherit its Target ID from the Target A of its parent alert definition, just like alerts that are not based on SQL.
However, by defining a different network object / type in the Target B / Target B type fields of an alert definition (SQL and non-SQL), users can generate alert instances that will point to the object specified in Target B rather than Target A in the Alert Instance grid.
See Alert Definition List for more information.