blob: a1a713bbbfaffa5ef4b92cd79d3259edf0f20ac2 [file] [log] [blame]
<?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'
#*****************************************************************************
#
# HOTMatchAndDiff_doc.php
#
# Author: Marcos Didonet Del Fabro
# Date: 2007-02-21
#
# Description: Type your page comments here - these are not sent to the browser
#
#
#****************************************************************************
#
# Begin: page-specific settings. Change these.
$pageTitle = "HowTo - Model difference use case";
$pageKeywords = "Model difference, match, HOT transformations, model weaving, ATL, AMW";
$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 is a step by step document that explains how to generate the generic match and difference transformations, and how
to execute them. <p/>
The use case was applied to two different KM3 models, <i>Relational</i> and <i>Class</i>. The initial configuration is set up to
the <i>Relational</i> models.
<h2>Installation</h2>
<ul>
<li>
Install ATL, AM3 (tested with CVS version of Feb 21st, 2007). Do not forget the <a href="www.antlr.org">antlr.jar</a>
and <a href="http://sourceforge.net/project/showfiles.php?group_id=36177">ant-contrib.jar</a> files. These jars are used in
the Ant Scripts.
</li>
<li>
Install the Atlas Model Weaver (tested with CVS version of Feb 21st, 2007). See the
<a href="http://www.eclipse.org/gmt/amw/download">download page</a>. This use case requires the installation
of the AMW Model Handler plug-in (org.eclipse.gmt.weaver.amw4atl).
</li>
<li>
Create a new Eclipse launch config (Eclipse Application). Tested with JRE 1.5.0_06.
</li>
<li>
Import the project <a href="HOTMatchAndDiff.zip">HOTMatchAndDiff</a> into the workspace</li>
</ul>
<h2>Configuration</h2>
<h4>Folder's description</h4>
<b>build/</b><br/>
<ul>
<li>
ATLFiles/ : contains the HOTs (higher-order transformations) used to generate the match, diff and patch transformations.
</li>
<li>
metamodels/ : contains the weaving metamodels for the match&diff, match parameters & TCS (for ATLModel2ATLFile).
</li>
<li>
models/ : contains the TCS (textual concrete syntax) model used to extract an ATL model into an ATL file. (ATL-0.2-TCS.ecore)
</li>
</ul>
<p/>
<b>metamodels/</b><br/>
This folder contains the input metamodels (Class and Relational). It is necessary to have a KM3 an an Ecore version of each metamodel.
<p/>
<b>models/</b><br/>
This folder contains the sample input models (KM3 and Relational), and the patched model.
<p/>
<b>output_matchAndDiff_&lt;KM3>/</b><br/>
This folder contains the weaving models generated after the match and diff transformations, and the patch transformation.
<p/>
<h4>Configuration of the Ant Scripts </h4><p/>
<ul>
<li>
Refresh Tab: select "Refresh the project containing the selected resource"
</li>
<li>
Build Tab: select "Build the project containing the selected resource"
</li>
<li>
Classpath Tab: add antcontrib.jar & antlr.jar
</li>
<li>
JRE Tab: select "Run in the same JRE as workspace"
</li>
<ul>
<p/>
The Ant Scripts should be modified depending on the input models or metamodels (it is initially set up to the "Relational" models).
To do this, modify the property <i>metamodel_name</i> according to the name of the metamodel (e.g., set up the property to "Relational" when using the
<i>Relational.km3</i> file) : <br/>
Example :
<i> <pre> &lt;property name="metamodel_name" value="Relational"/> </pre></i>
<h2>Execution</h2>
The example is divided in three phases: <p/>
<h4>Generating the transformations</h4>
This phase generates the metamodel-specific match and difference transformations.
The first step is to execute the <i>genMatchParameters.xml</i> script. This script generates a parameter model for a specific metamodel
(e.g., KM3 or Ecore). <p/>
Then, set up the <i>threshold</i> and <i>ratio</i> properties of the parameter model. The parameter model is located at
<i>matchAndDiff_<metamodelName>/MatchParameters_&lt;metamodelName>.ecore</i>. There are two examples previously configured in the
root folder. To use them, overwrite the file previously generated.
<p/>
Finally, execute the <i>GenMatchAndDiff.xml</i> script. This script executes the higher-order transformations that
generate the metamodel-specific match and diff transformations (in the <i>matchAndDiff_&lt;metamodelName></i> folder).
<h4>Executing the match and difference transformations</h4>
The <i>ApplyMatchAndDiff.xml</i> executes the metamodel-specific match and difference transformations. These transformations are generated
by the GenmatchAndDiff script. It is necessary to set up the <i>oldModelFilename</i> and <i>newModelFilename</i> properties (the script is
already pre-configured to execute the difference between the "Relational" models).<p/>
The match and diff results are in the folder <i>output_matchAndDiff_&lt;metamodelName></i>
<h4>Executing the patch transformation</h4>
The patch transformation is generated in the <i>output_matchAndDiff_&lt;metamodelName></i> folder.
Execute the ANT Script <i>applyPatch_&lt;oldModelFilename>-&lt;newModelFilename>.xml</i>. The patched model is generated in the
<i>models</i> folder.
<p/>
</div>
EOHTML;
# Generate the web page
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?>