Add or Edit a Trigger
To add or edit a trigger, navigate to the desired environment and open the Triggers tab. This section displays all existing triggers for the environment. Use the Add Trigger button to open the trigger details window, where new triggers can be configured or existing ones modified.
Trigger Actions
DATPROF Runtime supports two types of trigger actions: Execute Script and Send E-mail. Both actions utilize variables to provide information about the triggering event and allow access to all parameters defined in the environment.
Execute Script
The Execute Script
action allows you to run scripts directly on the machine where Runtime is installed. The behavior of the script depends on the operating system:
Windows: Scripts are executed using the Windows Command Prompt (cmd). Variables are accessed by enclosing them in percentages, e.g.,
%environment%
.Linux: Scripts are executed as Bash shell scripts. Variables are accessed using a dollar sign, e.g.,
$environment
.
DATPROF provides run-status and module-status variables, which are made available as environment variables in the script. The Test button allows you to execute the script with dummy variable values, and the results are displayed in the log panel.
Send E-mail
The Send E-mail
action sends notifications with three customizable properties:
Recipients: A space-, comma-, or semicolon-separated list of e-mail addresses.
Subject: Defined using Velocity templates, incorporating variables for dynamic content.
Body: Also a Velocity template, allowing dynamic data to be embedded in the message. For example, the environment name can be accessed using
${dpf.environment_name}
.
Both the subject and body of the e-mail are defined as Velocity templates. Within these templates, the run-status and module-status variables are available as Velocity parameters, prefixed with dpf.
. For example, the environment name can be accessed using ${dpf.environment_name}
.
For more details on using Velocity templates, you can refer to the official documentation at Apache Velocity.
Configuration Requirements:
Before using this action, ensure that e-mail settings are configured by an administrator:
Locate the
mail.properties.example
file in the<RuntimeData>/conf
folder.Rename it to
mail.properties
and update it with the correct settings.
DATPROF Runtime uses the Open Source JavaMail API for sending mails. A list of all the available configuration properties can be found here: JavaMail API
The Test button sends a sample e-mail using dummy variables to all listed recipients.
Both actions provide flexibility in automating workflows and ensuring efficient communication through triggers.
Trigger Conditions
Trigger on module-status
The Trigger on module-status condition is based on the status of a module during a run. This condition has a single property: the trigger status.
When an event occurs that signals a module has changed to the selected status, the corresponding action will be triggered.
The event is triggered once for every action that reaches the specified status.
Status | Description |
---|---|
ERROR | This status is triggered when a module is in error. |
WARNING | This status is triggered when a module has a warning. |
Trigger on module-status Variables
The following variables are available when a module-status event is triggered:
Variable name | As Windows | As Linux | As Email Velocity Variable | Description |
---|---|---|---|---|
event_type | %event_type% | $event_type | ${dpf.event_type} | The type of event that triggered the action (for this condition ' |
environment_id | %environment_id% | $environment_id | ${dpf.environment_id} | The id of the environment. |
environment_name | %environment_name% | $environment_name | ${dpf.environment_name} | The environment name. |
module_name | %module_name% | $module_name | ${dpf.module_name} | The name of the module. |
status | %status% | $status | ${dpf.status} | The trigger on-module status. |
run_id | %run_id% | $run_id | ${dpf.run_id} | The run id. |
cycle | %cycle% | $cycle | ${dpf.cycle} | The cycle of the module. |
try_count | %try_count% | $try_count | ${dpf.try_count} | The try count of the module. |
Trigger on run-status
The Trigger on run-status condition is activated when a run reaches a specific status. This condition allows you to define an action that will be triggered when the run transitions to the selected status.
The event is triggered once for each run that reaches the specified status, enabling you to automate responses based on the progress or completion of a run.
Status | Description |
---|---|
DONE | This status is triggered when a run finishes successfully. Will only occur once per run. |
ABORTED | This status is triggered when a run has been aborted by a user. Will only occur once per run. |
PAUSED | This status is triggered when a run is paused. Can be triggered multiple times during a run. |
ERROR | This status is triggered when a run has encountered an error. The condition will only be triggered upon encountering the first error, Any subsequent errors will be ignored. |
RUNNING | This status is triggered when a run is running again after the run has been idle, agent crashed or the run was resumed. |
CRASHED | This status is triggered when the Runtime agent has encountered. |
Trigger on Run-status Variables
The following variables are available when a run-status event is triggered:
Variable | As Windows | As Linux | As Email Velocity Variable | Description |
---|---|---|---|---|
event_type | %event_type% | $event_type | ${dpf.event_type} | The type of the event (for this condition 'run-status'). |
environment_id | %environment_id% | $environment_id | ${dpf.environment_id} | The id of the environment. |
environment_name | %environment_name% | $environment_name | ${dpf.environment_name} | The name of the environment. |
status | %status% | $status | ${dpf.status} | The trigger on-run status |
run_id | %run_id% | $run_id | ${dpf.run_id} | The run id. |