blob: cb22a596dd3bf40c30e79b870c1eef0347103edc [file] [log] [blame]
<div id="maincontent">
<div id="midcolumn">
<h1>Merge Operations</h1>
<p>
Merge operations merge several metamodel elements of the same type into a single element, whereas split operations split a metamodel element into several elements of the same type.
</p>
<h2 id="merge">Merge Reference into Another</h2>
<p>
In the metamodel, a reference is deleted. In the model, the values of this reference are merged to a compatible reference.
</p>
<p><h5>Parameters:</h5>
<ul>
<li><tt>toMerge</tt>: The reference that is deleted</li>
<li><tt>mergeTo</tt>: The reference to which the values are merged</li>
</ul>
</p>
<p>
<h5>Constraints:</h5>
<ul>
<li>The references must be different from each other</li>
<li>The reference to merge to must be multi-valued</li>
<li>The reference to merge to must be available in the context class</li>
<li>The types of the references must be compatible</li>
</ul>
</p>
<h2 id="partitionReference">Partition Reference</h2>
<p>
In the metamodel, a reference is partitioned into a number of references according to its type. A sub reference is created for each subclass of the reference's type. Finally, the original reference is deleted. In the model, the value of the reference is partitioned accordingly.
</p>
<p><h5>Parameters:</h5>
<ul>
<li><tt>reference</tt>: The reference to be partitioned</li>
</ul>
</p>
<p>
<h5>Constraints:</h5>
<ul>
<li>The reference must be multi-valued</li>
<li>The type of the reference must be abstract</li>
</ul>
</p>
<h2 id="replaceClass">Replace Class</h2>
<p>
In the metamodel, a class is deleted. In the model, instances of this class are migrated to another class based on a mapping of features.
</p>
<p><h5>Parameters:</h5>
<ul>
<li><tt>toReplace</tt>: The class to be replaced</li>
<li><tt>replaceBy</tt>: The class by which it is replaced</li>
<li><tt>featuresToReplace</tt>: The features to be replaced</li>
<li><tt>featuresReplaceBy</tt>: The features by which they are replaced (in the same order)</li>
</ul>
</p>
<p>
<h5>Constraints:</h5>
<ul>
<li>The replaced and replacing features have to be of the same size</li>
<li>The replace features must be defined in the replaced class</li>
<li>The replacing features must be defined in the replacing class</li>
<li>The replace features must cover all features from the difference between the class to replace and the class by which it is replaced</li>
<li>The class to be replaced must not have sub types</li>
</ul>
</p>
<h2 id="replaceEnum">Replace Enumeration</h2>
<p>
In the metamodel, an enumeration is replaced by another one. More specifically, the enumeration is deleted and the other enumeration used instead. In the model, the values of this enumeration are replaced based on a mapping of literals.
</p>
<p><h5>Parameters:</h5>
<ul>
<li><tt>toReplace</tt>: The enumeration to be replaced</li>
<li><tt>replaceBy</tt>: The enumeration by which it is replaced</li>
<li><tt>literalsToReplace</tt>: The literals to be replaced</li>
<li><tt>literalsReplaceBy</tt>: The literals by which they are replaced (in the same order)</li>
</ul>
</p>
<p>
<h5>Constraints:</h5>
<ul>
<li>The replacing literals must belong to the replacing enumeration</li>
<li>The replacing and replaced literals must be of the same size</li>
<li>The replaced literals must belong to the replaced enumeration</li>
</ul>
</p>
<h2 id="replaceLiteral">Replace Literal</h2>
<p>
In the metamodel, an enum literal is removed and replaced by another one. In the model, the enum's values are replaced accordingly.
</p>
<p><h5>Parameters:</h5>
<ul>
<li><tt>toReplace</tt>: The enum literal to replace</li>
<li><tt>replaceBy</tt>: The enum literal by which it is replaced</li>
</ul>
</p>
<p>
<h5>Constraints:</h5>
<ul>
<li>The enum literal by which it is replace must belong to the same enum.</li>
</ul>
</p>
<h2 id="splitStringAttribute">Split String Attribute</h2>
<p>
In the metamodel, a new String-typed attribute is created. In the model, the value of another String-typed attribute is split among the two attributes by means of a regular expression.
</p>
<p><h5>Parameters:</h5>
<ul>
<li><tt>toSplit</tt>: The feature whose values are split</li>
<li><tt>context</tt>: The class in which the new feature is created</li>
<li><tt>attributeName</tt>: The name of the new attribute</li>
<li><tt>pattern</tt>: The regular expression</li>
</ul>
</p>
<p>
<h5>Constraints:</h5>
<ul>
<li>The class with the new attribute must be a subclass of the class with the attribute to be split</li>
<li>The type of the attribute to split has to be String</li>
</ul>
</p>
<h2 id="uniteReferences">Unite References</h2>
<p>
In the metamodel, a number of references are united into a single reference which obtains their common super type as type. In the model, their values have to be moved accordingly.
</p>
<p><h5>Parameters:</h5>
<ul>
<li><tt>references</tt>: The references which are united</li>
<li><tt>unitedReferenceName</tt>: The name of the single reference which unites all the references</li>
</ul>
</p>
<p>
<h5>Constraints:</h5>
<ul>
<li>The references have to belong to the same class</li>
<li>The references must be all either cross or containment references</li>
</ul>
</p>
</div>
<div id="rightcolumn">
<div class="sideitem">
<h6>Contents</h6>
<ul>
<li><a href="org.eclipse.emf.edapt.declaration.creation.StructuralPrimitives.php">Structural Primitives</a></li>
<li><a href="org.eclipse.emf.edapt.declaration.simple.NonStructuralPrimitives.php">Non-structural Primitives</a></li>
<li><a href="org.eclipse.emf.edapt.declaration.generalization.GeneralizationOperations.php">Generalization / Specialization Operations</a></li>
<li><a href="org.eclipse.emf.edapt.declaration.inheritance.InheritanceOperations.php">Inheritance Operations</a></li>
<li><a href="org.eclipse.emf.edapt.declaration.delegation.DelegationOperations.php">Delegation Operations</a></li>
<li><a href="org.eclipse.emf.edapt.declaration.replacement.ReplacementOperations.php">Replacement Operations</a></li>
<li><a href="org.eclipse.emf.edapt.declaration.merge.MergeOperations.php">Merge Operations</a></li>
<ul>
<li><a href="#merge">Merge Reference into Another</a></li>
<li><a href="#partitionReference">Partition Reference</a></li>
<li><a href="#replaceClass">Replace Class</a></li>
<li><a href="#replaceEnum">Replace Enumeration</a></li>
<li><a href="#replaceLiteral">Replace Literal</a></li>
<li><a href="#splitStringAttribute">Split String Attribute</a></li>
<li><a href="#uniteReferences">Unite References</a></li>
</ul>
</ul>
</div>
</div>
</div>