activationInterval element

The <activationInterval> element contains elements that define when a rule is active and inactive.

Details

A rule can be activated or deactivated at a discrete point in time or by a specific event.

If you specify that a rule is to be activated, or deactivated, at a discrete point in time and by a specific event, the rule is activated, or deactivated, by whichever occurs first, the point in time or the receipt of the event. However, in this case, the rule might be activated or deactivated by many events throughout its life cycle. For example, a rule might be activated by an event, deactivated, activated at a defined point in time, deactivated again, and activated by another event.

In a business environment, you might want to activate a rule when an event is received that indicates that the stock exchange has opened for business. In an IT environment, you might want to start a maintenance window at 06:00 on 29 October 2005 and end it at one of the following times, based on whichever occurs first:
  • 11:30 on 30 October 2005
  • When an event is received that indicates that the maintenance work is complete

Attributes

<activationInterval> has no attributes.

Contained within

<activationInterval> is contained within the following elements:

Contains

<activationInterval> contains the following elements.

The elements must be coded in the order that is shown. If an element is optional, it does not need to be coded, but all elements that are coded must follow the correct order.

Table 1. Elements contained within the <activationInterval> element
Element Required or optional?
<activationTime> Optional. 0 or 1 occurrence is allowed.
<activateOnEvent> Optional. 0 or 1 occurrence is allowed.
<deactivateOnEvent> Optional. 0 or 1 occurrence is allowed.
<activationByGroupingKey> Optional. 0 or 1 occurrence is allowed.

Relationships among the contained elements

The <start> and <stop> elements that are contained within the <activationTime> element are a static method of activating and deactivating a rule. Through these elements, a rule is activated or deactivated at a discrete point in time. In contrast, the <activateOnEvent> and <deactivateOnEvent> elements are a dynamic method of activating and deactivating a rule. Through these elements, a rule is activated or deactivated if a certain event occurs. For example, a rule is activated by any event that meets the criteria that is defined for the <activateOnEvent> element, if the rule is not already active. A rule is deactivated by any event that meets the criteria that is defined for the <deactivateOnEvent> element, if the rule is not already inactive. Therefore, certain events can alter the static definition of when a rule is activated or deactivated.

Table 2 describes how and when a rule is activated or deactivated based on certain combinations in which the following elements might be coded:
  • <start>
  • <stop>
  • <activateOnEvent>
  • <deactivateOnEvent>
In Table 2, X represents the name of an event that activates the rule, and Y represents the name of an event that deactivates the rule.

If the <start> element is not coded at all, the default start time is the same as that defined by the <whenLoaded> element.

If the <stop> element is not coded at all, the default stop time is the same as that defined by the <never> element.

Table 2. Rule activity based on coding different combinations of the elements that are contained within <activationInterval>
<activationTime> <activateOnEvent> <deactivateOnEvent> Rule activity
<start> <stop>
<whenLoaded> <never>     Rule is active when it is loaded and remains active while the Active Correlation Technology engine is running.
<whenLoaded> <never>   Y Rule is active when it is loaded. Event Y deactivates the rule.
<whenLoaded> <never> X Y Rule is active when it is loaded. Event Y deactivates the rule, and event X reactivates it. This deactivation and reactivation can occur multiple times.
<whenLoaded> <after>     Rule is active when it is loaded, and it is deactivated after a specified time interval.
<whenLoaded> <dateTime>     Rule is active when it is loaded, and it is deactivated at a specified date and time.
<inactiveWhenLoaded> <never> X   Rule is inactive when it is loaded. Event X activates the rule, and the rule remains active while the Active Correlation Technology engine is running.
<inactiveWhenLoaded> <never> X Y Rule is inactive when it is loaded. Event X activates the rule, and event Y deactivates it. This activation and deactivation can occur multiple times.
<dateTime> <dateTime>     Rule is activated at a specified date and time and deactivated at a specified date and time.
<dateTime> <dateTime> X Y Rule is activated at a specified date and time and deactivated at a specified date and time. Event X activates the rule, and event Y deactivates it. Event X and Y can activate and deactivate the rule multiple times.
<dateTime> <never>     Rule is activated at a specified date and time and remains active while the Active Correlation Technology engine is running.
<dateTime> <never>   Y Rule is activated at a specified date and time. Event Y deactivates the rule.
<dateTime> <never> X Y Rule is activated at a specified date and time. Event Y deactivates the rule, and event X reactivates it. This deactivation and reactivation can occur multiple times.
<dateTime> <after>     Rule is activated at a specified date and time and deactivated after a specified time interval.
<dateTime> <after> X Y Rule is activated at a specified date and time and deactivated after a specified time interval. Event X activates the rule, and event Y deactivates it. This activation and deactivation can occur multiple times.