sequenceRule element

The <sequenceRule> element defines a rule according to the sequence pattern. The sequence rule is the only rule that allows multiple event selectors. It also requires a minimum of two event selectors.

Attributes

<sequenceRule> has the following attributes:

Table 1. Attributes of the <sequenceRule> element
Name Description Data type Required?
name Identifies the rule. This identifier must be unique within the rule block that contains this rule. It cannot contain a period. xsd:NMTOKEN Yes
processOnlyForwardedEvents Determines whether the rule receives all events or only events that are forwarded from other rules. The default value is false, which indicates that the rule receives all events, including those that are forwarded from other rules. xsd:boolean No
arrivalOrder Defines whether the events must arrive in the order in which the <eventSelector> elements are coded for the rule. The valid values are:
  • inOrder (the default value)
  • randomOrder
xsd:string No

If the value of the arrivalOrder attribute is randomOrder, the order in which the <eventSelector> elements are coded is important. The <eventSelector> elements with the most specific event selection criteria should be coded before the <eventSelector> elements with less specific event selection criteria. Otherwise, the sequence is not detected when it should be.

For example, assume the following circumstances:
  • Three <eventSelector> elements are defined.
  • The first <eventSelector> element is checking for the event eventA.
  • The second <eventSelector> element is checking for any event.
  • The third <eventSelector> element is checking for the event eventB.
  • The following events are presented to the system within the specified time window: eventA, eventB, eventC.
The rule behavior is as follows, and the sequence is not detected when it should be:
  1. The first event, eventA, is accepted by the first <eventSelector> element.
  2. The second event, eventB, is accepted by the second <eventSelector> element.
  3. The third event, eventC, is ignored.
Assume the following circumstances, where the <eventSelector> elements are coded correctly, with the most specific event selection criteria preceding the less specific event selection criteria:
  • The first <eventSelector> element is checking for the event eventA.
  • The second <eventSelector> element is checking for the event eventB.
  • The third <eventSelector> element is checking for any event.
The rule behavior is as follows, and the sequence is detected:
  1. The first event, eventA, is accepted by the first <eventSelector> element.
  2. The second event, eventB, is accepted by the second <eventSelector> element.
  3. The third event, eventC, is accepted by the third <eventSelector> element.

Contained within

<sequenceRule> is contained within the following element:

Contains

<sequenceRule> 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 2. Elements contained within the <sequenceRule> element
Element Required or optional?
<comment> Optional. 0 or 1 occurrence is allowed.
<variable> Optional. 0 or more occurrences are allowed.
<activationInterval> Optional. 0 or 1 occurrence is allowed.
<lifeCycleActions> Optional. 0 or 1 occurrence is allowed.
<eventSelector> 2 occurrences of this element are required for the sequence rule. Additional occurrences are allowed.
<groupingKey> Optional. 0 or 1 occurrence is allowed.
<timeWindow> Required. Only 1 occurrence is allowed.
<onDetection> Optional. 0 or 1 occurrence is allowed.
<onTimeOut> Optional. 0 or 1 occurrence is allowed.
Related concepts
Sequence pattern