Specifying triggers

A trigger defines a change in the value of a state, or a column in a database table that can initiate an event. An event handler handles an event only if one of its triggers had a change in value. Event handlers can have one or more triggers.

A single state in a trigger checks only that state. When multiple states are specified for a trigger, all of the states are checked and must occur for the event message to be sent. Multiple state triggers are specified as a comma-separated list of states.
Note: A separate event message is sent for every trigger with states that cause the event handler to run. The message contains information that identifies the trigger that caused it to be sent.

When you define multiple triggers of the same type for an event, such as presStates1 and presStates2, they must be numbered sequentially. Any break in the numbering causes the triggers that are defined after the break to be ignored. To avoid this problem, use the number sign (#) in place of a number. For more information, see Using sequenced parameters.

The not indicator, which is described in Specifying Value Modifiers and Special Values, can be used when triggers are specified. For example, to have an event handler send a message when a transaction is loaded and not balanced, specify the trigger as LOADED,~BALANCED. When multiple state triggers are specified, at least one of the states in the list cannot have the not indicator. An event trigger cannot be set to !LOADED,!BALANCED because both states are defined by using the not indicator.

Examples of event handlers that support multiple triggers are the PresentmentStatesEventHandler and the PaymentExceptionEventHandler.