Jump to: navigation, search

Difference between revisions of "AM3/Ant Tasks"

< AM3
(am3.atl)
(changed tables to use wiki syntax, and changed lists into sub-headings)
Line 6: Line 6:
 
==am3.loadModel==
 
==am3.loadModel==
  
* Description
+
===Description===
 +
 
 
This task is used to load a model.
 
This task is used to load a model.
 
This model may be a terminal model or a metamodel.
 
This model may be a terminal model or a metamodel.
 
The metametamodels are typically not loaded with this task since they come bundled with a model handler.
 
The metametamodels are typically not loaded with this task since they come bundled with a model handler.
  
* Parameters
+
===Parameters specified as attributes===
<table border="1">
+
  <tr>
+
    <th>Attribute</th>
+
    <th>Description</th>
+
    <th>Required</th>
+
    <th>Default value</th>
+
  </tr>
+
  <tr>
+
<td>name</td><td>Name of model in task context</td><td>Yes</td><td>None</td>
+
</tr>
+
<tr>
+
  <td>metamodel</td>
+
<td>Name of metamodel in task context</td>
+
<td>Yes</td>
+
<td>None</td>
+
</tr>
+
<tr>
+
  <td>path</td>
+
  <td>Path of file to load</td>
+
  <td>Yes</td>
+
  <td>None</td>
+
</tr>
+
<tr>
+
  <td>modelHandler</td>
+
  <td>Model handler of loaded model</td>
+
  <td>No</td>
+
  <td>EMF</td>
+
</tr>
+
</table>
+
  
* Parameters specified as nested elements
+
{| border="1"
 +
! Attribute    || Description                      || Required || Default value
 +
|+
 +
| name        || Name of model in task context    || Yes      || None
 +
|+
 +
| metamodel    || Name of metamodel in task context || Yes      || None
 +
|+
 +
| path        || Path of file to load              || Yes      || None
 +
|+
 +
| modelHandler || Model handler of loaded model    || No      || EMF
 +
|}
 +
 
 +
===Parameters specified as nested elements===
 +
 
 +
===Examples===
  
* Examples
 
 
  <am3.loadModel modelHandler="EMF" name="News" metamodel="MOF" path="/org.eclipse.am3.zoos.atlantic/News.ecore" />
 
  <am3.loadModel modelHandler="EMF" name="News" metamodel="MOF" path="/org.eclipse.am3.zoos.atlantic/News.ecore" />
  
Line 59: Line 44:
 
==am3.saveModel==
 
==am3.saveModel==
  
* Description
+
===Description===
 +
 
 
This task is used to save a model.
 
This task is used to save a model.
  
* Examples
+
===Examples===
  
 
  <am3.saveModel model="myXML" path="/test/opop.xml">
 
  <am3.saveModel model="myXML" path="/test/opop.xml">
Line 80: Line 66:
 
==am3.atl==
 
==am3.atl==
  
* Description
+
===Description===
  
 
The purpose of this task is to execute an [[ATL]] transformation.
 
The purpose of this task is to execute an [[ATL]] transformation.
Line 89: Line 75:
 
For instance: '%EMF' refers to Ecore and '%MDR' refers to MOF 1.4.
 
For instance: '%EMF' refers to Ecore and '%MDR' refers to MOF 1.4.
  
* Parameters
+
===Parameters specified as attributes===
<table border="1">
+
 
<tr>
+
{| border="1"
  <th>Attribute</th>
+
! Attribute || Description                       || Required
  <th>Description</th>
+
|+
  <th>Required</th>
+
| path     || Path of ATL transformation to run || Yes
</tr>
+
|}
<tr>
+
 
  <td>path</td>
+
===Parameters specified as nested elements===
  <td>Path of ATL transformation to run</td>
+
 
  <td>Yes</td>
+
====inModel====
</tr>
+
 
</table>
+
{| border="1"
 +
! Attribute || Description                            || Required
 +
|+
 +
| name      || Name of model in transformation context || Yes
 +
|+
 +
| model    || Name of model in task context          || Yes
 +
|}
 +
 
 +
====outModel====
 +
 
 +
{| border="1"
 +
! Attribute || Description                            || Required
 +
|+
 +
| name      || Name of model in transformation context || Yes
 +
|+
 +
| model    || Name of model in task context          || Yes
 +
|+
 +
| metamodel || Name of metamodel in task context      || Yes
 +
|}
 +
 
 +
====library====
  
* Parameters specified as nested elements
+
{| border="1"
* inModel
+
! Attribute || Description                               || Required
<table border="1">
+
|+
<tr>
+
| name     || Name of library in transformation context || Yes
  <th>Attribute</th>
+
|+
  <th>Description</th>
+
| path     || Path of library                           || Yes
  <th>Required</th>
+
|}
</tr>
+
<tr>
+
  <td>name</td><td>Name of model in transformation context</td><td>Yes</td>
+
</tr>
+
<tr>
+
  <td>model</td><td>Name of model in task context</td><td>Yes</td>
+
</tr>
+
</table>
+
* outModel
+
<table border="1">
+
<tr>
+
  <th>Attribute</th>
+
  <th>Description</th>
+
  <th>Required</th>
+
</tr>
+
<tr>
+
  <td>name</td><td>Name of model in transformation context</td><td>Yes</td>
+
</tr>
+
<tr>
+
  <td>model</td><td>Name of model in task context</td><td>Yes</td>
+
</tr>
+
<tr>
+
  <td>metamodel</td><td>Name of metamodel in task context</td><td>Yes</td>
+
</tr>
+
</table>
+
*  library
+
<table border="1">
+
<tr>
+
  <th>Attribute</th>
+
  <th>Description</th>
+
  <th>Required</th>
+
</tr>
+
<tr>
+
  <td>name</td><td>Name of library in transformation context</td><td>Yes</td>
+
</tr>
+
<tr>
+
  <td>path</td><td>Path of library</td><td>Yes</td>
+
</tr>
+
</table>
+
  
* Examples
+
===Examples===
  
 
  <am3.atl name="/AMMA-Tools/TCS2Problem.atl">
 
  <am3.atl name="/AMMA-Tools/TCS2Problem.atl">

Revision as of 12:40, 17 July 2006


am3.loadModel

Description

This task is used to load a model. This model may be a terminal model or a metamodel. The metametamodels are typically not loaded with this task since they come bundled with a model handler.

Parameters specified as attributes

Attribute Description Required Default value
name Name of model in task context Yes None
metamodel Name of metamodel in task context Yes None
path Path of file to load Yes None
modelHandler Model handler of loaded model No EMF

Parameters specified as nested elements

Examples

<am3.loadModel modelHandler="EMF" name="News" metamodel="MOF" path="/org.eclipse.am3.zoos.atlantic/News.ecore" />
<am3.loadModel modelHandler="EMF" name="IN" metamodel="KM3" path="/org.eclipse.am3.zoos.atlantic/Amble.km3">
 <injector name="ebnf">
  <param name="name" value="KM3" />
 </injector>
</am3.loadModel>
<am3.loadModel name="myXML" metamodel="XML" path="/test/testQuery.xml">
 <injector name="xml" />
</am3.loadModel>

am3.saveModel

Description

This task is used to save a model.

Examples

<am3.saveModel model="myXML" path="/test/opop.xml">
 <extractor name="xml" />
</am3.saveModel>
<am3.saveModel model="news_model" path="/test/news.ecore" />
<am3.saveModel model="IN" path="/test/MyKM3.km3">
 <extractor name="ebnf">
  <param name="format" value="KM3.tcs"/>
  <param name="indentString" value=" "/>
  <param name="serializeComments" value="false"/>
 </extractor>
</am3.saveModel>

am3.atl

Description

The purpose of this task is to execute an ATL transformation. The models used by a transformation are referenced by their IDs as defined at their loading time (see AM3_Ant_Tasks#am3.loadModel).

There is an exception for metametamodels, which are typically already available from the model handler. A metametamodel is referenced by a string composed of a percent character (i.e. '%') followed by the name of the model handler. For instance: '%EMF' refers to Ecore and '%MDR' refers to MOF 1.4.

Parameters specified as attributes

Attribute Description Required
path Path of ATL transformation to run Yes

Parameters specified as nested elements

inModel

Attribute Description Required
name Name of model in transformation context Yes
model Name of model in task context Yes

outModel

Attribute Description Required
name Name of model in transformation context Yes
model Name of model in task context Yes
metamodel Name of metamodel in task context Yes

library

Attribute Description Required
name Name of library in transformation context Yes
path Path of library Yes

Examples

<am3.atl name="/AMMA-Tools/TCS2Problem.atl">
 <inModel name="IN" model="metamodel.tcs"/>
 <inModel name="TCS" model="TCS"/>
 <inModel name="MM" model="metamodel.km3"/>
 <inModel name="KM3" model="KM3"/>
 <inModel name="Problem" model="Problem"/>
 <library name="KM3Helpers" path="/AMMA-Tools/KM3Helpers.asm" />
 <library name="strings" path="/AMMA-Tools/strings.asm" />
 <outModel name="OUT" model="metamodel.pbs" metamodel="Problem"/>
</am3.atl>