IBM BPM, V8.0.1, All platforms > Authoring services in Integration Designer > Developing monitor models > Create monitor models > Defining monitor details models
Defining triggers for monitoring contexts
You must define triggers to cause outbound events to be sent, and you might also want to define triggers to update metrics, stopwatches, or counters based on special conditions. To define a trigger, you specify its evaluation times and its trigger condition.
Evaluation times can be periodic, or based on occurrences such as inbound events, value changes of metrics, other triggers firing, or a combination of these. When an evaluation time has arrived, the trigger condition is evaluated. If the condition is true, the trigger fires. You can prevent repeated firing (for example, to avoid redundant notifications of the same problem) by declaring the trigger non-repeatable.
To define a trigger:
Procedure
- Click the Monitor Details Model tab of the editor, right-click the monitoring context (or any element of the monitoring context) in the model tree, and click New > Trigger.
- In the Create New Trigger window, type a name in the Name field and click OK. The name is limited to 256 characters. As you type the name, a default ID is created for you, although you can change it if you prefer. The ID is required and must be unique within the monitoring context. The ID must be an XML NCName (non-colonized name), which means that it must start with a letter or underscore and that it can contain only letters, digits, underscores, hyphens, and periods.
The trigger is added to the model tree under the monitoring context, and the form editor opens so that you can define the trigger.
- In the form editor, type a description in the Description field. The description is used only in the Monitor Model editor and is not displayed anywhere in Business Monitor. The character set is unrestricted.
- To cause the trigger to fire multiple times, select Trigger is repeatable. The results depend on whether you have set a condition, as follows:
Trigger is repeatable Condition is set Result Checked Yes The trigger fires when the condition first resolves to true, and then continues to fire every time that the trigger is evaluated and the condition remains true. Unchecked Yes The trigger fires when the condition first resolves to true, and then does not fire again unless the condition resolves to false and then to true again. Checked No The trigger fires every time the trigger is evaluated. Unchecked No The trigger fires only the first time the trigger is evaluated. - To terminate the monitoring context when the trigger fires, select Terminate monitoring context. Typically you will select this option if this trigger is firing as a result of a Terminate inbound event. All child monitoring contexts under this monitoring context are also terminated if this option is selected.
- Under Trigger Sources, click Add or double-click a row to add a source for the trigger and complete the following steps. The source determines when the trigger is evaluated. Each trigger must have at least one source.
- To evaluate the trigger condition based on a time interval or on a specific time, select one of the following choices:
- Recurring evaluation, if you want to specify how much time should elapse before a trigger condition is evaluated
A low recurring evaluation time interval (for example, every minute) results in frequent trigger evaluations that can cause performance problems under high volumes. Additionally, if the trigger is repeatable and there is an associated notification alert, users might receive excessive notifications. Consider using a longer recurring evaluation time interval.
- Specific time evaluation, to indicate a specific time when the trigger condition should be evaluated
- Daily evaluation, to indicate that the evaluation should occur at the same time every day
After making your selection, click OK and provide the required information.
For example, if you selected Recurring evaluation, click the Source cell, click the button that is displayed to open the Select Duration window, and specify the time interval.
- To evaluate the trigger condition when a metric, counter, or key is updated, select Other source type. Select the metric, counter, or key from the list and click OK. The trigger condition will be evaluated whenever the metric, counter, or key is updated, even if the update does not result in a new value.
For example, if a metric has a value of 5, its metric value expression is evaluated, and the value is set to 5 again, any trigger that has the metric as its source type will be evaluated.
- To evaluate the trigger condition when an inbound event arrives, select Other source type. Select the inbound event from the list and click OK.
- To evaluate the trigger condition when another trigger fires, select Other source type. Select the trigger from the list and click OK.
- Optional: Specify the trigger condition. This condition is a Boolean expression. If the condition evaluates to true, the trigger fires. (Exception: A non-repeatable trigger might not fire each time the condition evaluates to true, as described in the table in Step 4.) If you press Ctrl+Space for content assist, a small window is displayed to help you write the expression. In this window, you can select valid operators, functions, and the following elements within your model:
- Metrics, counters, and stopwatches in the same or a higher-level monitoring context.
- Metrics, counters, and stopwatches in child contexts and down, but only if the trigger is evaluated because of a trigger firing, an event arriving, or a metric, counter, or key being updated in that same child context.
- Inbound event attributes, but only if the trigger is evaluated as the result of this inbound event arriving.
See "Expression support" for supported expressions, and see your event definition for a list of valid attributes.