Create notification templates

Notification templates define the format of the information that you want to send in email notifications for specific situations.

Create a notification template

Notification templates are XML files located in the server profile's conf/server/notification-template directory.

Deployment Automation provides a set of built-in templates:

  • AgentGoesOffline
  • ApplicationDeploymentFailure
  • ApplicationDeploymentSuccess
  • ApprovalCreated
  • ApprovalFailed
  • DeploymentReadied
  • DeploymentPackageFailure
  • DeploymentPackageStarted
  • DeploymentPackageSuccess
  • ProcessRequestStarted
  • TaskCreated

If these notification templates do not suit your needs, you can create new ones.

To create a notification template:

  1. Create an XML file.

  2. Enter a script.

    Note: Notification templates support only Velocity reports. For more information on Velocity templates, see http://velocity.apache.org/engine/.

  3. Save the file in the server profile's conf/server/notification-template directory. The default location is:

    • Windows: C:\Users\<username>\.microfocus\da\conf\server\notification-templates
    • UNIX/Linux: /opt/MicroFocus/da/<username>/.microfocus/da/conf/server/notification-templates
  4. Restart the server.

Back to top

Properties for notification templates

You can use properties from various Deployment Automation objects in your notification templates.

The following tables list some of the most useful properties.

Common properties

Property Description Type
fn Object with helper functions DeployTemplateHelper
snapshot Object containing data about the application snapshot; nullable Snapshot
environment Object containing data about the environment where the process ran Environment
application Object containing data about the application of the executed process; nullable Application
externalUrl URL of the Deployment Automation server String

Process execution request properties

Property Description Type
workflowTrace Trace of request execution; nullable WorkflowTrace
analysis Results of the execution, available if workflowTrace is not null; nullable FilteredAnalysis
failureAnalysis Results of the execution, filtered by only failed steps and available if workflowTrace is not null; nullable FilteredFailureAnalysis
request Object with request data ApplicationProcessRequest
applicationProcess Object with application process data ApplicationProcess
versions List of component versions List<Version>
properties Map with process properties. See Examples of keys in the properties map. Map<String, String>
user User who submitted the request User
resourceFactory Provides access to other DA objects ResourceFactory

Approval request properties

Property Description Type
approval Approval request data Approval
tasks List of approval tasks List<ApprovalTask>
appRequest Object containing data about the process request; is null if compRequest is available (nullable) ApplicationProcessRequest
compRequest Object containing data about the process request; is null if appRequest is available (nullable) ComponentProcessRequest
requester User who submitted the request User
scheduledDate Data of approval Date
processId Process ID String
requestType Type of request String

Back to top

Basic velocity examples

The following examples show how the notification template properties may be used in common Velocity statements.

Back to top

Examples of keys in the properties map

The following list provides examples of keys that can be used in the properties map, or dictionary, for process execution requests:

  • applicationProcess.id
  • applicationProcess.name
  • deploymentPackage.id
  • deploymentPackage.name
  • dpRequest.id
  • dpRequest.user.name
  • dpRequest.user.displayName
  • dpRequest.user.id
  • environment.id
  • environment.name
  • request.id
  • request.user.name
  • request.user.displayName
  • request.user.id
  • server.url

Note: The default templates use getName(), but the listed keys can also be used.

Back to top

See also: