About Alert Sources

An alert source is a way to raise an alarm if (for example) a given Process Definition or Chain Definition reaches a particular status, such as Console or Error. When an alert source is triggered, it can send an Operator Message and/or use escalations to make sure the issue is resolved.

There are different types of alert sources.

Each alert source uses specific rules to determine:

  • What triggers the alert. This is different for each type of alert source.
  • Which escalation to use if the issue is not resolved promptly.
  • The text and valid responses for the Operator Message (if any).

The following topic covers features that are shared by all alert sources.

Substitution Parameters

Substitution parameters let you customize an alert source's Email Address, Operator Message Expression, and the Alert Source Email Body.

  • In the Email Address and Operator Message Expression fields, you can use the ${substitution_parameter} syntax.

  • In the email Body field, you can use the ${substitution_parameter} syntax and the [?<REL_expression>?] syntax. You can refer to process and Chain parameters with the [?=parameters.MyParameter?] and [?=chainParameters.MyParameter?] syntaxes, respectively.

Here are some popular substitution parameters to use with process alert sources. For the full list, see Scripting Contexts and Implicit Objects.

  • ${jobDefinition}: The name of the Process Definition.
  • ${jobDefinitionOwner}: The owner of the Process Definition.
  • ${jobId}: The ID of the process.
  • ${topLevelJobId}: The ID of the highest parent.
  • ${jobOwner}: The owner of the process.
  • ${oldStatus}: The old status of the process.
  • ${newStatus}: The new status of the process.
  • ${MyParameter}: The IN value of the process parameter named MyParameter.
  • parameters.name: The value of input parameter 'name' of the process, available in REL. The value of the field must be prefixed with =.
  • outParameters.name: The value of output parameter 'name' of the process, available in REL. The value of the field must be prefixed with =.
  • ${topLevelQueue}: The name of the Queue of the highest parent process.
  • ${remoteStatus}: The status in the remote system.
  • ${returnCode}: The return code of the process.
  • ${queue}: The Queue of the process.

Parameters with the ${MyParameterName} syntax can be entered verbatim. For example:

SAP process with ID ${jobId} running on SAP System ${SAP_SYSTEMS} failed!

If you want to use REL expressions such as parameters.name or Time.now(), use REL syntax (=<REL>):

='Parameter Param1: ' + parameters.Param1

To mix REL and non-REL substitution parameters, do this:

='Process ${jobId} has a parameter Param1 with the following value: ' + parameters.Param1

Customizing Alert Emails

You can customize emails on the Alert Source Email tab with conditional evaluation and REL expressions.

Conditional evaluation looks like this:

[?if test="expression"?]
text
[?endif?]

REL expressions look like this:

[?=expression?]

The following example email body contains a mixture of different syntaxes for illustration purposes.

Copy
<html>
<head><title>Email</title></head>
<body>

[?if test="parameters.SAP_SYSTEMS == 'PR1' || parameters.SAP_SYSTEMS == 'PR2'"?]
SAP process in client [?=parameters.CLIENT?] on important SAP System ${SAP_SYSTEMS} had an error.
Time now is [?=Time.now('Europe/Berlin')?].
[?endif?]

[?if test="alertSourceType === 'AdHocAlertSource'"?]
Ad hoc alert data: [?=data?]
[?endif?]

Link <a
href="https://prd1.example.com/redwood/api-permalink/show?link-objecttype=[?=alertSourceType?]&link-uniqueid=[?=alertSourceUniqueId?]">
  alert source
  </a>
</body>
</html>

Note: Only ad hoc alert sources can resolve the data parameter in the Email body, Processes alert sources, for example, cannot resolve process parameters in an email body.

Specifying Recipients in the Email Body

There are several ways to specify the recipient of an email, one of which is to simply add it to the headers of the email in the Alert Source Email tab. To do so, add [Headers] to the end of the email, after the closing </html> tag, and after that list the recipients you want to send the email to, like so:

Copy
...
</html>
[Headers]
To=jdoe@example.com,jsmith@example.com
CC=bjones@example.com

Substitution Parameters in Emails

The following substitution parameters can be used in emails.

  • ${<object>.name}: The name (i.e., getErrorName()) of the object.
  • ${<object>.url}: A PermaLink URL for the object.
  • ${<object>.link}: A fully formed link. For example: <a href="link.htm">name</a>

Here, <object> can be one of the following:

  • object: The alert.
  • operatorMessage: The Operator Message for the alert.