Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "VIATRA/CEP/Examples"

< VIATRA‎ | CEP
 
(29 intermediate revisions by the same user not shown)
Line 1: Line 1:
=VIATRA-CEP Examples=
+
The following demonstrations highlight the essentials of the VIATRA-CEP framework using a simple example introduced by Martin Fowler, commonly referred as the ''state machine DSL'', presented in his [http://martinfowler.com/books/dsl.html DSL book]. The sources are available from the official [http://git.eclipse.org/c/viatra/org.eclipse.viatra.examples.git VIATRA Examples repository]. To run them, the [[VIATRA/CEP#Installation|environment must be set up first]].
The following demonstrations highlight the essentials of the VIATRA-CEP framework using a simple example introduced by Martin Fowler, commonly referred as the ''state machine DSL'', presented in his [http://martinfowler.com/books/dsl.html DSL book]. The sources are available on GitHub.
+
  
==Example #1: Simple event processing==
+
*[[VIATRA/CEP/Examples/SimpleEventProcessing|Simple event processing]]
We are about to design a security system which controls secret compartments in a real estate. The system is rather old-school. For example, one would open a drawer first then turn on the light and knock on the wall twice to open a compartment. For that purpose, sensors are installed on the significant points of the real estate which emit events if something interesting happens; and a central controller deals with the events. The essentials of complex event modeling and processing are obvious even in this plain simple example:
+
*[[VIATRA/CEP/Examples/ModelEvents|Processing model events]]
*we would like to depict the interesting happenings as atomic events (e.g. a knocking on the wall) and
+
*[[VIATRA/CEP/Examples/EcoreIntegration|Processing Ecore notifications]]
*complex events (e.g. a series of events which would open a secret compartment), then
+
*define actions to be executed based on identified complex event patterns (e.g. to open a secret compartment), and finally,
+
*employ some sort of a central reasoning system to process atomic events and identify complex event patterns.
+
 
+
===Modeling atomic events===
+
We follow the conventions of the original example, i.e. identify atomic events using four-character IDs. We have different sensors on stock: a door sensor (DO), a drawer sensor (DW), a light swich sensor (LI) and a wall sensor (WL). The door is either in a closed (''DOCL'') or open (''DOOP'') state. On every state change, an event is triggered with the given four-character ID. The same applies for the drawer (''DWOP'', ''DWCL''). Similarly, the light can be turned on (''LION'') or off (''LIOF''). Finally, every knock on the wall triggers a separate event (''WLKC''). The outlined events will serve as the '''atomic events''' in our example.
+
 
+
Let's define the above atomic events using '''VEPL''', i.e. the '''VIATRA-CEP Event Processing Language'''.
+
 
+
'''AtomicEvent''' DOCL(){}
+
'''AtomicEvent''' DOOP(){}
+
'''AtomicEvent''' DWCL(){}
+
'''AtomicEvent''' DWOP(){}
+
'''AtomicEvent''' LIOP(){}
+
'''AtomicEvent''' LIOF(){}
+
'''AtomicEvent''' WLKC(){}
+
 
+
The complete source is available --here--. (For the sake of simplicity, the events do not feature parameters, nor any special features, hence the empty parentheses and braces.)
+
 
+
===Modeling complex event patterns and actions===
+
Setting up the security system is a twofold task: (i) we have to deploy the mentioned sensors, and (ii) we have to configure them. The latter on means that we have to define the '''complex event patterns''' to depict the "security codes" of the customer; and we also have to define the '''actions''' triggered when these complex event patterns are identified.
+
 
+
====Example security codes====
+
...give some examples to demonstrate the features of the language
+
 
+
==Example #2: Reasoning over non-materialized models==
+
One of the great features of VIATRA-CEP is the tight integration with EMF-IncQuery, an incremental query engine for EMF models, which enables defining event patterns essentially describing elementary or compound changes in EMF models.
+

Latest revision as of 05:53, 30 October 2015

The following demonstrations highlight the essentials of the VIATRA-CEP framework using a simple example introduced by Martin Fowler, commonly referred as the state machine DSL, presented in his DSL book. The sources are available from the official VIATRA Examples repository. To run them, the environment must be set up first.

Back to the top