Trigger expression syntax
You can enter expressions for triggers in a sequence job to set values and define custom values. The expression syntax is a subset of the full syntax that is available in the BASIC Transformer stage for parallel jobs, and the Transformer stage for server jobs.
Use the built-in expression editor to ensure that your expressions are valid. The following list includes the values that you can enter to create valid expressions for your triggers.
- Literal strings enclosed in double-quotes or single-quotes
- Numeric constants (integer and floating point)
- Parameters for the sequence job
- Prior activity variables, such as job exit status
- All built-in BASIC functions in server jobs
- The following macros and constants:
- DSHostName
- DSJobController
- DSJobInvocationId
- DSJobName
- DSJobStartDate
- DSJobStartTime
- DSJobStartTimestamp
- DSJobWaveNo
- DSProjectName
- Arithmetic operators, such as the plus symbol (+), minus symbol (-), multiplication symbol (*), and division symbol (/)
- Relational operators, such as the greater than symbol (>), less than symbol (<), and equals sign (=)
- Logical operators (AND or NOT) plus usual bracketing conventions
- Ternary operators such as IF, THEN, and ELSE
Custom trigger expression syntax
You can use variables when defining trigger expressions for Custom, ReturnValue, and UserStatus conditional triggers. The following table describes the variables that you can use for each of the supported activity types.
In the table, activity_stage is name of the activity. You can also use the job parameters from the sequence job.
Custom triggers in Nested Condition and Sequencer activities can use any of the variables in the above table used by the activities connected to them.
| Activity type | Variable | Use |
|---|---|---|
| Exception Handler (these are available for use in the sequence of activities the stage initiates, not the stage itself) | activity_stage.$ErrMessage |
The text of the message that will be logged as a warning when the exception occurs. |
activity_stage.$ErrNumber |
Returns an error code that indicates the reason
that the Exception Handler activity was invoked:
|
|
activity_stage.$ErrSource |
The stage label of the activity that triggered the exception. For example, an activity stage called a job that failed to run. | |
| Execute Command | activity_stage.$CommandName |
The name of the command that the activity ran, including the path name if one was specified. |
activity_stage.$CommandOutput |
The output captured from running the command. | |
activity_stage.$ReturnValue |
The command status. | |
| Job Activity | activity_stage.$JobName |
The name of the job that was run, including the invocation ID if present. |
activity_stage.$JobStatus |
The value of the job status for the completed job. | |
activity_stage.$UserStatus |
The value of the user status for the selected job. | |
| Routine Activity | activity_stage.$ReturnValue |
The value of the routine return code. |
activity_stage.$RoutineName |
The name of the routine that was called. | |
| Wait For File Activity | activity_stage.$ReturnValue |
The value returned by the DSWaitForFile subroutine:
|