-
Notifications
You must be signed in to change notification settings - Fork 3
Tutorial
The following presents a step-by-step guide to the functionalities of Echo.
Echo is deployed as an Eclipse plugin-in (although a CLI version is also available). The following image depicts the default Echo perspective, which can of course be customized by the user.
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.
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 is 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 team, in order to present models that resemble the metamodel structure as much as possible.
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 Next button, while selecting a solution (which actually applies the repair to the model resource) is done through the Select button.
Model consistency management consists of checking and recovering of the consistency between models and their metamodels. The simplest way to track a model in Echo is by right-clicking in a XMI resource, and selecting Echo > 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.
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. 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. 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, 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 tracked models at the Echo toolbar, or at the Project Properties under Echo > Tracked models.
Consistency constraints between models are specified by QVT-R transformations. Again, a new constraint can be inserted by right-clicking a QVT-R resource and selecting Echo > Add 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.
Models 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 at the Echo toolbar, or at the Project Properties under Echo > Manage constraints.
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.
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.