EMF allows cross-model references facilitating modularity in models. However, when a model is deleted or moved in the workspace, cross-model references can become inconsistent. Concordance is a model notification framework included in Epsilon and provides a client for managing cross-model references.
In this article, we demonstrate the way in which Concordance can be used to automatically report problems with cross-model references and automatically reconcile cross-model references when a model is moved.
Suppose we have two graph models, with cross-references from one model to another. Diagrammatically, such a model could look like this:
Clearly, if GraphTwo is changed, the edges between B1/B2 and C can become inconsistent. Concordance will report an error if GraphTwo is deleted or if C is removed from GraphTwo. Additionally, if GraphTwo is moved in the workspace, Concordance will automatically update the references from B1/B2, which are stored in GraphOne.
Enabling the Concordance nature
To use Concordance it must be enabled for your project. To enable Concordance, right-click your project and select Concordance→Enable Concordance Nature. Subsequent changes to models in your project will be monitored by Concordance.
Reports of dangling cross-references
When a model element is removed, Concordance determines whether any other model elements reference the deleted element. References to deleted elements are reported as dangling, and an error marker is shown on the referencing resource. For example, suppose we delete GraphTwo (shown in the diagram above). Concordance reports the following errors on GraphOne:
Reconciliation of cross-references
When a model is moved in the workspace, Concordance automatically updates references to elements of the moved model. For example, suppose GraphTwo (shown above is moved into a different folder):
Concordance automatically updates the references in GraphOne that refer to the C node in GraphTwo: