Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
VIATRA/CEP/Examples/ModelEvents
Example #2: Processing model change events
A unique feature of the VIATRA-CEP framework is the seamless integration with the model management framework EMF and the incremental graph pattern matcher EMF-IncQuery. This enables observing special events, which depict compound model changes in an underlying EMF model. A compound model change is a series of elementary model changes (ADD, MODIFY, DELETE, etc). To depict compound model changes, the EMF-IncQuery framework is used.
To demonstrate this scenario, we take the previous example and will model the SC3O complex event.
The underlying model and the graph patterns
The whole sample project for the model is available here.
First, we need an Ecore metamodel to track the changes in the room.
Using a Generator Model, we generate the model code.
Now we can define graph patterns via EMF-IncQuery. To simplify the example, we only want to observe the states of drawers. Therefore, we define the following graph patterns.
Event patterns
The whole sample project with the event patterns is available here.
We will reuse these IncQuery graph patterns in event patterns. The [[VIATRA2/CEP/Language#IncQuery_event_patterns|IncQuery event pattern] type