Contents:

Graphical Modeling Editor for Event Pattern

In this section, we describe our graphical editor that supports the modeling of event patterns –the situations to be detected in a particular domain and the actions to be notified to interested users by email or social networking services, among others–. This editor has been implemented using GMF and Epsilon.

Thanks to this editor, users will be able to address the execution of steps 3, 4 and 5, essential for defining patterns in an intuitive way, according to our model-driven approach. Thereby, the editor would provide any user with the description of situations and actions for a domain without knowledge of any concrete EPL or language for implementing actions. Additionally, the editor enables the validation and storage of pattern models, their exportation and importation in order to share them with other users, as well as their transformation into both pattern code to be added to a CEP engine and action code to be deployed into an ESB.

The figure below shows the built editor for event pattern definition. This editor has the same four parts as the CEP domain editor: a tool palette, a canvas, a menu and a property view.

Note that in the property view of an event pattern model, the optional Pattern Priority property allows us to tag a pattern with a priority value. The default priority value is 0 (the lowest priority) for all patterns. When an event is required to be processed by multiple patterns, processing begins with the highest priority pattern and finishes with the lowest-priority pattern.

Graphical modeling editor for event pattern

Editor Palette

The editor palette has 42 tools for designing event patterns, as depicted in the table below. This palette can be dynamically reconfigured from different CEP domain models, enabling users to enjoy a graphical interface adapted to the specific context required.

Specifically, the Simple Events category is customized with all event types provided by a modeled CEP domain whereas Complex Events is customized with the complex event types defined when designing event patterns for a particular domain. As with the CEP domain editor, this editor allows users to substitute icons with one another and ensures that the tool palette is used correctly. Since the complex event type defined in an event pattern model is automatically incorporated in the palette as a tool in order to reuse it in other pattern models, it will be possible to create an event pattern hierarchy, i.e. a pattern depending on others.

Category Name Description Notation
Link It defines the graphical representation of one or more relationships between operands and operators. Link
Value It defines a Boolean, Integer, Long, Double, Float or String value. If a string value is set as current_timestamp, it will represent the right now. Value
GroupBy It groups events depending on one or more event property names. Value
Simple Events Event It describes an event type for a concrete CEP domain. Event
EventProperty It describes a feature of an event. Nested properties are supported. Event Property
Complex Events ComplexEvent It describes the complex event type to be created upon pattern detection. Complex Event
ComplexEvent Property It describes a feature of a complex event. Nested properties are supported. Complex Event Property
Pattern Timers TimerInterval It waits for the specified time period (years, months, weeks, days, hours, minutes, seconds and milliseconds) before turning to true. Time Interval
TimerSchedule It turns into true at a defined time (dayOfWeek, dayOfMonth, month, hour, minute, second). Time Schedule
WithinTimer It is permanently evaluated to false if the contained pattern expression does not turn to true during the specified time period (years, months, weeks, days, hours, minutes, seconds and milliseconds). Within Timer
Pattern Operators Every It selects every event belonging to the specified type. Every
EveryDistinct It is similar to Every, but eliminates duplicated results according to a given distinct-value expression. Every Distinct
FollowedBy It determines a pattern expression that must be followed by another. Followed By
Range It specifies the minimum (lowEndpoint) and maximum (highEndpoint) number of times a pattern expression must occur. Range
Repeat It defines how many times (count) a pattern expression must occur. Repeat
Until It checks a pattern expression until the condition (another pattern expression) is evaluated to true. Until
While It checks a pattern expression while the condition (another pattern expression) is evaluated to true. While
Logical Operators And It returns a true value only if all operands are true. And
Or It returns a true value if at least one operand is true. Or
Not It returns a true value if the operand is false, and a false value if the operand is true. Not
Comparison Operators Equal It returns a true value if operand1 = operand2. Equal
GreaterEqual It returns a true value if operand1 ≥ operand2. Greater Equal
GreaterThan It returns a true value if operand1 > operand2. Greater Than
LessEqual It returns a true value if operand1 ≤ operand2. Less Equal
NotEqual It returns a true value if operand1 ≠ operand2. Not Equal
Arithmetic Operators Addition It adds two numeric values. Addition
Division It divides one numeric value by another. Division
Modulus It returns the remainder of dividing one numeric value by another. Modulus
Multiplication It multiplies two numeric values. Multiplication
Subtraction It subtracts one numeric value from another. Subtraction
Aggregation Operators Avg It returns the average of the values in an expression. Avg
Count It returns the number of values in an expression. Count
Max It returns the highest value in an expression. Max
Min It returns the lowest value in an expression. Min
Sum It adds the values in an expression. Sum
Data Windows Batching EventInterval Tumbling window up to the specified number of events (size). Batching Event Interval
Batching TimeInterval Tumbling window that batches events and releases them every specified time period (years, months, weeks, days, hours, minutes, seconds, milliseconds). The optional startTimestamp serves as a reference point to batch flush times and must be provided as a long-value of milliseconds relative to January 1st, 1970. If startTimestamp is not specified and the first event arrives at time t1, then the batch flushes at time t1 plus time period and every time period thereafter. Batching Time Interval
Sliding EventInterval Sliding window by the specified number of events (size). Sliding Event Interval
Sliding TimeInterval Sliding window by the specified time period (years, months, weeks, days, hours, minutes, seconds, milliseconds). Sliding Time Interval
Actions Email It indicates an email must be sent with the complex event created when detecting its corresponding event pattern. Email
Twitter It indicates a message must be sent to a Twitter account with the complex event created when detecting its corresponding event pattern. Twitter

Options Menu

The editor's menu bar is available in any Eclipse application. In addition to menus by default, a CEP Domain menu of the domain editor has been added along with a new menu called Event Pattern:

  • New: it creates a new event pattern.
  • Duplicate Existing Pattern: it facilitates the event pattern's creation from another one.
  • Open: it opens one of the previously modeled event patterns.
  • Save and Validate: it saves the active event pattern model and validates it, listing encountered problems, if any.
  • Generate and Deploy Pattern Code: it transforms the chosen validated event pattern model into code.
  • Delete: it eliminates one event pattern.

By integrating the CEP domain editor with the event pattern editor, users are provided with all functionalities in a single editor. In addition to Import CEP Domain and Export CEP Domain, two more options have been added to the File menu:

  • Import Event Patterns: it allows the importation of previously defined event patterns.
  • Export Event Patterns: it permits exporting already modeled and validated event patterns together with their CEP domain.

We would like to point out that, in the current version of this editor, transformation rules have been created to automatically transform pattern models into Esper EPL and XML action code. It is important to highlight that our editor can be extended to support other languages since it allows modeling patterns regardless of the language finally used for their implementation. To this end, new transformation rules per EPL or language for implementing actions which is to be incorporated in the editor, in order to transform pattern models to this new language, must be created.


Last updated: October, 10th 2017