<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Configuring ATL Transformations in MOSKitt1</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Javier Muñoz</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Miguel Llacer</string-name>
          <email>mllacer@prodevelop.es</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Begoña Bonet</string-name>
          <email>bonet_beg@gva.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Conselleria de Infraestructuras y Transporte, Generalitat Valenciana</institution>
          ,
          <addr-line>Av. Blasco Ibáñez, 50 46010 València</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Prodevelop S.L, Plaza Don Juan de Villarrasa</institution>
          ,
          <addr-line>14 - 5 46001 VALENCIA</addr-line>
          ,
          <country country="ES">SPAIN</country>
        </aff>
      </contrib-group>
      <fpage>50</fpage>
      <lpage>59</lpage>
      <abstract>
        <p>Model transformations need to be configured in order to satisfy particular user requirements in real scenarios. This paper introduces an strategy for configuring ATL transformations. This strategy, that is currently in practice in the MOSKitt tool, follows a model driven approach, where both the specification of configuration options and the user selections of those options are implemented as models. Additionally, the user interfaces that are provided by MOSKitt for selecting the configuration options are briefly introduced.</p>
      </abstract>
      <kwd-group>
        <kwd>ATL</kwd>
        <kwd>model transformation</kwd>
        <kwd>MOSKitt</kwd>
        <kwd>model driven engineering</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>Model transformations play a key role in model driven software development
approaches. Different kinds of model transformation (refinements, refactoring,
translations, etc.) are applied during the development process in order to achieve the
desired products (source code, reports, etc.). When developing a model
transformation, the transformation analyst may identify different options for
transforming some elements. One of these options may fit better in some scenario or
satisfy some requirement whether other option may be more suitable in other
scenarios. Therefore, in an industrial context, mechanisms for configuring the
transformation in order to select between different options must be provided by model
driven software engineering tools.</p>
      <p>
        In this paper we introduce an approach for supporting the configuration of ATL [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
transformations. The approach is based on the definition of a configuration model that
is used as input by the transformation in order to generate the output following the
1 The budget provided by Generalitat for funding these actions may have fundings of the European Regional Development Fund (ERDF)
through the Programa Operativo de la Comunitat Valenciana 2007-2013
user guidelines. This strategy has been defined in the context of the MOSKitt project
[2] and it is currently implemented in the Eclipse-based MOSKitt2 tool.
      </p>
      <p>The MOSKitt project aims to provide a set of open source tools and a
technological platform for supporting the execution of software development
methods which are based in model driven approaches, including graphical modeling
tools, model transformations, code generation and collaboration support. This project
is led by the Conselleria de Infraestructuras y Transporte (CIT) (Ministry of
Infrastructures and Transport) of the Regional Government of Valencia, in Spain. The
project was initiated in 2007 and their results are currently in practice by CIT and
other companies and ministries in Spain.</p>
      <p>The paper is structured as follows. Next in this section a running case study is
introduced to illustrate the contents proposed approach. In Section 2 the strategy for
implementing the configuration of ATL model transformation is introduced. Section 3
discusses how to deal with the configuration information in ATL transformation.
Then, Section 4 presents the user interfaces that are currently available in MOSKitt to
select the configuration options. Finally, Section 5 includes some conclusions and
outlines our future works in this area.
1.1</p>
      <p>Case Study
In order to describe the approach for configuring model transformation, the classical
transformation from UML2 to database models will be used. In this transformation
we can find some patterns in the input models where different options can be selected.
In this paper we will use as an example the transformation of UML2 Generalization
elements into database elements.
currentLevel), adding an extra Column for specifying the kind of Person
(Person, Student or Professor).
2. OnlyChildTable: Transforming only leaf Classes into Table elements
(Student and Professor in our example) and converting properties into
columns (Professor table will have name and account columns whereas
Student table will have name and currentLevel columns).
3. AllTables: Transforming every Class into a Table with a Column for every
property and adding foreign keys from the Tables derived from specific
Classes to the Tables derived from the general Classes (from Student to
Person and from Professor to Person).</p>
      <p>Of course, other UML2 elements can have transformation configuration options like,
for instance, many to many associations, compositions and enumerations.
2</p>
      <p>
        Approach for Configuring Model Transformations
The approach for configuring model transformations introduced in this paper, which
is depicted in Figure 2, follows a model driven strategy. Models are used both for
capturing the information about which are the transformation options and for
specifying the options that a user has selected for executing the transformation.
Attending the classification of configuration techniques that is introduced in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], we
follow a Domain Specific Language approach.
      </p>
      <p>Rules for
Transf. “X”</p>
      <p>Input
Model “A”</p>
      <p>ATL Config.</p>
      <p>Initializer
for Transf. “X”</p>
      <p>Config. of
Model A for
Transf. “X”</p>
      <p>ATL
Transformation “X”</p>
      <p>Output
Model “B”</p>
      <p>The metamodel of the Rules Catalog model is depicted in Figure 3. A Catalog is
composed of ConfigurationPatterns. Different transformation Rules can be applied to
a ConfigurationPattern.</p>
      <p>The selected options for an specific execution of the transformation are specified in
a transformation configuration model. In our approach, ATL transformations
automatically generates the initial configuration with the default options selected for
the input model. This configuration model specifies for each configurable element in
an input model which rule is selected. Users can modify the transformation
configuration model to select the configuration rules that satisfy their needs. The
metamodel of the Configuration model is depicted in Figure 4.
Finally, the ATL transformation reads the configuration as an input model and
modifies their behavior according to the user selections. It is important to note that it
is the transformation responsibility taking into account the options that are selected in
the configuration model in order to produce the expected output.</p>
    </sec>
    <sec id="sec-2">
      <title>4 Configuring ATL Transformations</title>
      <p>As introduced in the section above, two ATL transformations must be implemented to
support the configuration of model transformations: the transformation for generating
the initial configuration options and the transformation which must support the
configuration.</p>
      <p>The first transformation (catalog2configuration.atl) takes as input a model with the
catalog of configuration rules and the model to be configured and produces the initial
configuration:
create OUT : CONFIGURATION from IN : CATALOG, INMODEL : UML;</p>
      <p>CONFIGURATION!ConfiguredPattern,
CONFIGURATION!SpecificInstance
}
for (param in confPattern.parameter-&gt;select(e |</p>
      <p>e.lowerValue = e.upperValue and e.upperValue = 1)) {
if (param.name = 'Unique Constraint') {
if (elem.oclIsTypeOf(UML!Association)) {
if (elem.isOneToOne() and elem.betweenClasses()) {</p>
      <p>thisModule.generateParameterValue(o, param);
}
else {
}
}</p>
      <p>}
thisModule.generateParameterValue(o, param);
}
thisModule.resolveTemp(confPattern.eContainer(),'o').patterns
&lt;thisModule.resolveTemp(confPattern.eContainer(),'o').patterns.append(o);
}</p>
      <p>}</p>
      <p>As it has been introduced in the previous section, is a transformation responsibility
to deal with the configuration information to generate the suitable output. A simple
but effective strategy to provide the desired behavior is to implement a different ATL
rule for each configuration option. Using this approach, additional conditions are
added in the FROM part of the rule checking which configuration option must be
applied.</p>
      <p>rule GeneralizationParent2Table {
from
i : UML!Class (
i.oclIsTypeOf(UML!Class) and
i.executeGeneralizationRule('OnlyParentTable') and
}</p>
      <p>… )
do { … }</p>
      <p>
        This strategy performs well when only one configuration pattern is applied to an
element. In case that several kind of options can be selected for one element, we
should implement as rules as possible combination of options. For instance, if
Generalization could also be configured using another criteria with two options, we
should implement (3*2) six rules. In this scenario, a potential strategy to avoid the
explosion in the number of rules would be to implement a unique rule with a DO
section in charge of discriminating the configuration options and calling rules that
implement the different transformation actions. This behavior may be implemented
more naturally adding a transformation phasing [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] mechanism to ATL.
      </p>
      <p>Our configurable ATL transformation generates DB models and traces taking as
input UML2 models and the configuration model. This transformation can be found
in the public MOSKitt repository3.
create OUT : DB, trace : Trace from IN : UML, modelConf : CONF;</p>
      <p>In the configuration of the generalization, we follow the approach where a rule is
implemented for every transformation configuration option. Therefore, we have
implemented three different rules:
rule GeneralizationParent2Table {
from
i : UML!Class (
i.oclIsTypeOf(UML!Class) and
i.isHierarchyParent() and
i.isPersistentClass() and
i.executeGeneralizationRule('OnlyParentTable')
-- generate Parent Table
thisModule.generateTable(i);
--generate additional attribute: 'tipo_&lt;class_name&gt;'
thisModule.createAdditionalColumn(i, i.getTable());
-- process child class
if (i.getTable() &lt;&gt; OclUndefined) {</p>
      <p>thisModule.processChildFromParentTable(i, i.getTable(), Sequence{});
}
}</p>
      <p>)
do {
}</p>
      <p>}
rule GeneralizationChild2Table {
from
i : UML!Class (
i.oclIsTypeOf(UML!Class) and
i.isHierarchyParent() and
i.isPersistentClass() and
i.executeGeneralizationRule('OnlyChildTable')
)
do {
thisModule.processChildFromTakeDownProperties(i, Sequence{i}, Sequence{});
}
rule Generalization2Tables {</p>
      <p>from
i : UML!Class (
i.oclIsTypeOf(UML!Class) and
i.isHierarchyParent() and
i.isPersistentClass() and
i.executeGeneralizationRule('AllTables')
)
do {
-- generate table
thisModule.generateTable(i);
-- process child class
thisModule.processChildFromAllTables(i);
}</p>
      <p>}
The creation of the tables (and columns, if necessary) has been implemented in ATL
called rules in order to facilitate the maintenance of the code
5 User Interface for Configuring Model Transformations
MOSKitt provides a forms editor for editing the transformation configuration models.
This editor, which is depicted in Figure 5, shows in the left side a tree with the model
elements that can be configured. When a configuration is selected in the editor, users
can edit their properties in the right side of the editor, including the desired
configuration rule and the configuration parameters, if any is available. Once the
configuration model has been edited, users can initiate the execution of the
transformation from this editor.</p>
      <p>Additionally, the functionality of the transformations configurations editor has
been integrated as a property sheet of the graphical editors. This property sheet shows
the configuration options for the element that is selected in the graphical editor.
Therefore, users can select the transformation configuration options while they are
editing the model.</p>
      <p>The configuration of ATL transformations have also been integrated in the
MOSKitt wizard for executing transformations. This wizard provides a sequence of
pages (1) for gathering transformation parameters, (2) for providing output about the
validation of inputs, (3) for configuring the transformation and (4) for showing the
results of the transformation configuration. In the page for configuring the
transformation, that is shown in Figure 6, users can select a previously used
configuration model, can create a new configuration model or can use the default
configuration selections. If a new configuration wants to be created, the configuration
editor with the default configuration model is automatically opened.</p>
    </sec>
    <sec id="sec-3">
      <title>6 Conclusions and Future Works</title>
      <p>The approach for configuration ATL model transformations that is introduced in this
paper is currently applied in the open source MOSKitt tool. Several ATL
transformations can be configured to modify their behavior attending user
requirements, including the UML2 to DB transformation with 19 configuration
options. This approach is also applied to other kind of transformation like, for
instance, code generation transformations implemented with XPand.</p>
      <p>As future works, the usability of the editor of configuration models will be
analyzed and increased as much as possible, since it is a key piece from the users
point of view. Additionally, we plan to extend the rules catalog metamodel to be
capable of expressing dependencies (requirements and exclusions) between
configuration rules.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Jouault</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kurtev</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Transforming models with ATL</article-title>
          .
          <source>In: Satellite Events at the MoDELS 2005 Conference</source>
          . Volume
          <volume>3844</volume>
          of Lecture Notes in Computer Science., Springer-Verlag (
          <year>2006</year>
          )
          <fpage>128</fpage>
          -
          <lpage>138</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <surname>de las Administraciones</surname>
          </string-name>
          <article-title>Públicas (TECNIMAP</article-title>
          <year>2007</year>
          ). Gijón, Spain. 2007
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>D.</given-names>
            <surname>Wagelaar</surname>
          </string-name>
          and
          <string-name>
            <given-names>R. van der</given-names>
            <surname>Straeten</surname>
          </string-name>
          .
          <article-title>A Comparison of Configuration Techniques for Model Transformations</article-title>
          .
          <source>In 2nd European Conference on Model Driven Architecture - Foundations and Applications</source>
          (ECMDA-FA
          <year>2006</year>
          ), Bilbao, Spain,
          <source>July 10-13</source>
          , pages
          <fpage>331</fpage>
          -
          <lpage>345</lpage>
          ,
          <year>2006</year>
          . 17
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Cuadrado</surname>
            ,
            <given-names>J. S.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Molina</surname>
            ,
            <given-names>J. G.</given-names>
          </string-name>
          <year>2007</year>
          .
          <article-title>A phasing mechanism for model transformation languages</article-title>
          .
          <source>In Proceedings of the 2007 ACM Symposium on Applied Computing</source>
          (Seoul, Korea, March
          <volume>11</volume>
          - 15,
          <year>2007</year>
          ).
          <source>SAC '07. ACM</source>
          , New York, NY,
          <fpage>1020</fpage>
          -
          <lpage>1024</lpage>
          . DOI= http://doi.acm.
          <source>org/10</source>
          .1145/1244002.1244223
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>