| <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon()); # All on the same line to unclutter the user's desktop' |
| |
| #***************************************************************************** |
| # |
| # AMW_Match_SF_doc.php |
| # |
| # Author: Marcos Didonet Del Fabro |
| # Date: 2005-07-24 |
| # |
| # Description: Type your page comments here - these are not sent to the browser |
| # |
| # |
| #**************************************************************************** |
| |
| # |
| # Begin: page-specific settings. Change these. |
| $pageTitle = "HowTo - Metamodel comparison use case"; |
| $pageKeywords = ""; |
| $pageAuthor = "Marcos Didonet Del Fabro"; |
| |
| # Paste your HTML content between the EOHTML markers! |
| $html = <<<EOHTML |
| |
| <!-- Main part --> |
| <div id="midcolumn"> |
| <table width="100%"> |
| <tr> |
| <td width="50%"> |
| <h1>$pageTitle</h1> |
| </td> |
| </tr> |
| </table> |
| |
| <p> |
| |
| This HowTo explains how to create weaving models that are used to compare metamodels and to produce ATL transformation. <p/> |
| |
| The general approach of this use case is explained in more details in the <a href="../../usecases/">Use Cases</a> section. |
| |
| <h2>Instructions</h2> |
| |
| <b>Metamodels</b>: these metamodels are injected into Ecore by clicking in the context menu "Inject KM3 into Ecore metamodel":<br/> |
| - <i>Scade.km3</i><br/> |
| - <i>ScadeNew.km3</i>; <br/> |
| |
| <h4>Producing a new weaving model</h4> |
| A weaving model containing a reference to the woven models (Scade versions) is created manually using the AMW wizard. It creates one |
| root element:<br/> |
| |
| <p/> |
| <ul class="midlist"> |
| <li> |
| In the "models" folder, select "New...", "Weaving Model". |
| </li><p/> |
| <li> |
| <b>In the AMW wizard first page</b>, the following metamodel extensions must be selected: <br/> |
| <i>- mw_base_extension.km3:</i> the base extension to the core metamodel. It extends all abstract classes of the core weaving metamodel.<br/> |
| <i>- mmw_match.km3:</i> defines simple links between classes, attributes and references.<br/> |
| <i>- mmw_compare.km3:</i> defines links with elements without any equivalence in both metamodels.<br/> |
| <i>- mmw_propagation.km3:</i> defines a set of auxiliary structures to execute the Similarity Flooding algorithm.<br/> |
| </li><p/> |
| <li> |
| <b>In the wizard second page</b>, select "New model" and fill the text field with the name of the weaving model (ScadeCmp.amw). After that, select "MatchModel" as the current "WModel". |
| This type of WModel must be selected to be able to execute the matching heuristics correclty. |
| </li><p/> |
| <li> |
| <b>The wizard third page</b> sets up the two models that will be woven. Select first the "leftM" model, and click on "Edit selected model". |
| This button opens a new window. Select "ModelRef" in the "WModelRef" combo. Then |
| select "DefaultWovenPanelExtension", that is the implementation for this type of "WModelRef" (standard identification mechanism of EMF). |
| Finally, select "Scade.ecore" in the metamodel text field. <br/> |
| The same procedure must be done for the right metamodel, "ScadeNew.ecore". |
| </li> |
| </ul> |
| |
| <h4>Executing the matching transformations</h4> |
| |
| The AMW plug-in provides a set of matching transformations that automate the task of creating weaving models. To execute these transformations, |
| open the context menu of the weaving panel (the middle panel) and select the "Match" submenu. |
| This submenu contains a list of the matching transformations available. <br/> |
| This use case executes 5 matching transformations: "Cartesian product", "Name Equality", "Threshold", "Link rewriting" and |
| "Link rewriting - non equivalence". Each matching transformation produces a new weaving model, and adds a predefined suffix to it. This is because we don't want to override the current model. |
| Thus, the new weaving model should be opened to be able to execute the subsequent transformation. |
| <p/> |
| <ul class="midlist"> |
| <li> |
| Cartesian product: produces a Cartesian product of the elements with the same type. It produces a new weaving model with the suffix |
| "_cp" (ScadeCmp_cp.amw). |
| </li> |
| <li> |
| Name equality: this transformation assigns a high similarity value to the elements that have the same name. |
| It produces a model with the suffix "_equal". (ScadeCmp_cp_equal.amw) |
| </li> |
| <li> |
| Threshold: selects the links with the highest similarity values. |
| Produced model: (ScadeCmp_cp_equal_thres.amw). Suffix: "_thres" |
| </li> |
| <li> |
| Link rewriting: reorganizes the links according to the containment relationships between Classes, Attributes and References. |
| Produced model: (ScadeCmp_cp_equal_thres_lr.amw). Suffix: "_lr" |
| </li> |
| <li> |
| Link rewriting - non equivalence: creates links with the elements that do not have equivalence in the left or right metamodels. |
| Produced model: (ScadeCmp_cp_equal_thres_lr_noneq.amw). Suffix: "_noneq" |
| </li> |
| </ul> |
| |
| <h4>Generating and extracting the ATL transformation</h4> |
| |
| The AMW plug-in contains a higher-order transformation (HOT) that interprets the weaving model and that produces an ATL transformation. |
| To execute this transformation, open the context menu of the weaving panel (the middle panel) and select the "Transform" submenu. Then click on "Generate transformation (HOT)". |
| This action produces an ATL model (ScadeCmp_cp_equal_thres_lr_hot.ecore). <br/> |
| The output transformation model is extracted to an ATL file by clicking in the context menu "Extract ATL-0.2 model to ATL-0.2 file".<br/> |
| |
| <p/> |
| <b>Installation requirements:</b> <p/> |
| The AMW, ATL and AM3 plug-ins must be installed. See the <a href="../../download">download page</a>. |
| <p/> |
| <b>Remark(s):</b></p> |
| All the injection and extraction menus (Ecore and ATL) are available in the "AM3" perspective and in the "AM3 Resource Navigator" view. |
| <p/> |
| </div> |
| |
| EOHTML; |
| |
| |
| # Generate the web page |
| $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); |
| ?> |