Triggers

Triggers provide a powerful interface into the business environment through the invocation of customizable instructions.

Figure 16. Triggers

Instruction

The Trigger Instruction field contains either the LOG_MESSAGE or the executable/script path to be invoked, as well as arguments to be passed to the invoked executable/script.

Trigger instructions are based on Java Formatted Strings. The following link provides more information on formatted strings.

http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html#summary

Trigger Types

Triggers are available in 3 types {LOG, EXEC, SYNC_EXEC}

It is critical to note the following when creating EXEC and SYNC_EXEC triggers:

  1. Any system executable that is in the environment PATH is invokable.

  2. The trigger executable MUST either be in the PATH or MUST be fully qualified. The executable must have execute mode set on UNIX systems.

  3. The executable MUST return in a reasonable amount of time

  4. The executable MAY return error messages to STDERR which will be displayed if the return value is greater than 0.

Executable Type

When Trigger Type EXEC or SYNC_EXEC is selected then an Executable Type should be selected. EXTERNAL is used by default if this argument is not provided.

Further Script Engines will be available in future releases, including but not limited to [Ruby, PHP, JavaScript, AWK, etc]

Trigger Points

Various points exist at which an assigned trigger will be invoked. These are identified as follows

Arguments

The system provides a list of arguments that could be available when a trigger is invoked. Certain arguments are only available at specific Trigger Points, if a specified argument is not available at the Trigger Point then a list of valid arguments will be logged.

In addition to the system provided arguments it is possible to specify custom arguments. These custom arguments are matched against the MessageProperties of a provided ProcessingMode Event.

When an embedded trigger type is selected such as JYTHON, JEP, or JSON-RPC the arguments (both provided and custom) will be set as environment variables within the embedded system.

Arguments may be referenced using the instruction field. The instruction field is interpreted using Java Formatted Strings and the supplied arguments. Arguments are referenced using the following string %1$s where the 1$ is the argument number (seen next to each argument) and the s denotes the value is a string.

The following link provides more information on formatted strings:

https://docs.oracle.com/javase/1.5.0/docs/api/java/util/Formatter.html#summary