Skip to content
Nuno Macedo edited this page May 28, 2018 · 26 revisions

Echo step-by-step tutorial

The following presents a step-by-step guide to the functionalities of Echo.

Echo environment

Echo is deployed as an Eclipse plugin (although a CLI version is also available). The following image depicts the default Echo perspective, which can of course be customized by the user.

Echo perspective

Blue borders denote parts introduced by Echo (the Graph Viewer and the Echo toolbar), while red borders denote Eclipse parts over which Echo relies. Echo's functionalities can be accessed either by right-clicking on an appropriate resource (XMI, Ecore or QVT-R), through the Echo toolbar or through the Echo page of a project's properties.

Echo toolbar

Graph Viewer

The Graph Viewer view is an essential component of the workbench, as it allows the user to navigate through the solutions proposed by Echo. It basically comprises the Alloy graph viewer, with themes inferred by Echo that better suit its functionalities. Echo retrieves information from the metamodel in order to generate this theme, in order to present models that resemble the metamodel structure as much as possible. [talk about customization of move to a new page]

Every time a solution is presented, i.e., a repaired model, the user can navigate to the original model in order to inspect the differences through the << and >> buttons. If dealing with inter-model consistency repairs, he can navigate through both original models.

Navigating through different solutions is done through the NextNext button, while selecting a solution (which actually applies the repair to the model resource) is done through the SelectSelect button.

Model consistency management

[show additional constraint] [show operations]

Model consistency management consists of checking and recovering the consistency between models and their metamodels. The simplest way to track a model in Echo is by right-clicking on a XMI resource, and selecting Echo > Track model Track model.

Track model

Once tracked, Echo automatically tests the consistency every time the resource is changed. When an inconsistency is detected, Echo flags the model as inconsistent and creates error markers over it. The markers show up in the Problems view, where the user can then choose to repair that model by right-clicking Quick fix.

Problems view

Echo provides two alternative distances to fix the model: graph edit distance or an operation-based distance. After selecting the model distance metric, Echo starts searching for a solution following our least-change algorithm.

Everything in Echo is performed in an online setting, integrating seamlessly in the development process. Check and repair tasks are run in the background, and can be inspected (and cancelled) in the Progress view.

Problems view

Once a minimal solution is found, it is presented to the user in the Graph Viewer view. The user is able to inspect the proposed solution depicted as a graph. If the user is not pleased with the proposed solution, he can ask for the next minimal solution by clicking Next Next. In case there are no more minimal solution, Echo increases the distance to the original model and proposes next-to-minimal solutions. Once the user finds a suitable solution, he may click Select Select, and the proposed solution is applied to the XMI model resource.

The list of tracked models can be managed at any time by clicking Manage models Manage tracked models at the Echo toolbar, or at the Project Properties under Echo > Tracked models.

Inter-model consistency management

Consistency constraints between models can be specified by QVT-R transformations. Again, a new constraint can be inserted by right-clicking a QVT-R resource and selecting Echo > New constraint New inter-model constraint....

New constraint

A dialog opens up asking the user to select the two models to be related by the constraint. Models should be selected in the same order as the QVT-R transformation parameters.

Once a constraint is created, every time one of the models is updated, Echo will also check if it is still consistent with the other. If an inconsistency is found, both models are flagged as inconsistent. By inspecting the Problems view, two markers are presented, one for each model. Thus, the user may choose which model should be fixed in order to restore consistency. As expected, the user is again able to choose the model distance used, and the minimal solutions are presented in the Graph Viewer.

Model repair for inter-model consistencies are also guaranteed to conform to their meta-models. Thus, when adding a constraint over two models, they are also automatically tracked for intra-model consistency. If a model has intra-model inconsistencies, an inter-model constraint over it cannot be repaired by updating the opposite model. This is because no update on the latter will recover consistency on the former.

Echo is able to handle multiple constraints over the same model, or the same constraint over different models.

The constraints being tracked by Echo in a project can be managed by clicking Manage constraints Manage constraints at the Echo toolbar, or at the Project Properties under Echo > Manage constraints.

Model generation

A metamodel conformant XMI model resource can be generated from an Ecore resource. This can be performed by right-clicking on an Ecore resource Echo > Generate model Generate model.

Generate model

In the model generation dialog, the user is able to specify the cardinality of each of the metamodel classes. The cardinality of classes that are not specified are minimized: an empty scope produces the minimal model (which is not necessarily the empty model, due to metamodel constraints).

As expected, produced solutions can be navigated in the same way as the solutions proposed for model repair, under the Graph viewer. Once the user selects the desired solution, a new XMI model resources is created that corresponds to it. The model will be automatically tracked by Echo.

If the user wants to constraint the structure of the generated models, he can specify additional constraints in the metamodel. For this purpose, annotations titled Echo/Gen are only interpreted by the model generator.

Clone this wiki locally