About Ad Hoc Alert Sources
You can raise Ad Hoc Alerts with the System_Alert_Send Job Definition or with a custom script using RedwoodScript. You can put the Job Definition or RedwoodScript code into a Workflow Definition in order to implement customized alerting. The System_Alert_Send Job Definition takes two parameters:
- The name of the Ad Hoc Alert Source.
- An optional Data parameter that can be used to determine the escalation to use. You can use this as a substitution parameter in Alert Source expressions and the Alert Source email body.
Simple Ad Hoc Alert Source
Assume you have a Workflow Definition that loads some data into a data warehouse. When the load is complete, you want to trigger an escalation named DataWarehouseLoaded
. To accomplish this, you could do the following:
-
Create an Ad Hoc Alert Source where Default Alert Escalation is
DataWarehouseLoaded
. -
In the Workflow Definition, add a Step after the data is loaded, and have that Step raise the Ad Hoc alert using the System_Alert_Send Job Definition.
Complex Ad Hoc Alert Source
Assume you have a Workflow Definition that loads some data into a data warehouse. When the load is complete, you want to trigger one of several different escalations, depending on what kind of data was loaded. For example, if you the data is from the EMEA region, you want to use the Data_Mart_EMEA
escalation, but otherwise you want to use the Data_Mart_Default
escalation. To accomplish this, you could do the following:
-
Create the
Data_Mart_EMEA
andData_Mart_Default
escalations. -
In the Step that loads the data, create a string Out Parameter that is set to
EMEA
for EMEA data orDefault
for other data. -
In the Workflow Editor, map the Out Parameter to the Data parameter on the System_Alert_Send Job Call.
-
In the Ad Hoc Alert Source, instead of specifying a Default Alert Escalation, specify an Escalation Expression that incorporates the Data parameter, like so:
DataMart_${data}
When the System_Alert_Send Job Definition is run, the escalation run depends on the value of the Data parameter:
- If the data is
EMEA
, the escalation DataMart_EMEA runs. - Otherwise, the escalation DataMart_Default runs.