Based on material developed in ATHENA (IST-507849), INTEROP (IST-508011) and MODELWARE (IST-511731) 6-1b. Atlas Transformation Language (ATL) with RSM.

Slides:



Advertisements
Similar presentations
Profiles Construction Eclipse ECESIS Project Construction of Complex UML Profiles UPM ETSI Telecomunicación Ciudad Universitaria s/n Madrid 28040,
Advertisements

© The ATHENA Consortium From PIM4SOA to Web Services,
June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Transforming models with ATL The A TLAS Transformation Language Frédéric Jouault ATLAS.
OCL2 April A presentation of OCL 2 Object Constraint Language Christian Hein, Fraunhofer FOKUS April 2006.
© 2007 ATLAS Nantes 1 Atlas Model Weaver Use Case: Aspect Oriented Modeling Marcos Didonet Del Fabro Atlas Group (INRIA & LINA), Université de Nantes,
Query/Views/Transformations © 2006 ATLAS Nantes Query/Views/Transformations An introduction to the MOF 2.0 QVT standard with focus on the Operational.
Presented by Farhana Islam (CU ) Md Riyadh (CU ) Comparison Between Two Model Transformation Frameworks: Kermeta and ATL Presentation.
Families to Persons © 2007 ATLAS Nantes "Families to Persons" A simple illustration of model-to-model transformation Freddy Allilaire Frédéric Jouault.
© The ATHENA Consortium. CI2: The ATHENA Interoperability Framework Module 2: e-Procurement Scenario Furniture Sector 2.
1Business Models – REA Ontology Resources Events Agents The REA Ontology.
Automated Tests in NICOS Nightly Control System Alexander Undrus Brookhaven National Laboratory, Upton, NY Software testing is a difficult, time-consuming.
XML Metadata Interchange (XMI)
ANDROID PROGRAMMING MODULE 1 – GETTING STARTED
CRSX plug-in development. Prerequisites Software and Libraries Eclipse RCP (3.5 or higher) –Go –Select.
SEEM4570: XAMPP, Eclipse, Summary of Html Kangfei Zhao Room 711,ERB
© The ATHENA Consortium. CI2: The ATHENA Interoperability Framework Module 3: Collaborative Product Development Scenario Aeronautics and Aerospace.
Overview of ATL and ETL (Jouault and Kurtev 2006, ‘Transforming Models with ATL’, Proc. MODELS 2005 Workshops, LNCS, vol. 3844, pp Kolovos et.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Spectra Software Defined Radio Products Applying Model Driven Design, Generative Programming, and Agile Software Techniques to the SDR Domain OOPSLA '05.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
© The ATHENA Consortium. EM1 - Enterprise Modelling as a way to achieve Interoperability Module 4 - How does Enterprise Modelling address these.
An Approach and Tool for Synchronous Refactoring of UML Diagrams and Models Using Model-to-Model Transformations Hafsteinn Þór Einarsson Helmut Neukirchen.
© The ATHENA Consortium From PIM4SOA to Peer-2-Peer (P2P),
Faculty of Informatics and Information Technologies Slovak University of Technology Peter Kajsa and Ľubomír Majtás Design.
© The ATHENA Consortium. EM1 - Enterprise Modelling as a way to achieve Interoperability Module 2 - What are the current methods and tools for.
SYSE 802 John D. McGregor Module 0 Session 1 Course Introduction.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Purpose  This training course describes how to configure the the C/C++ compiler options.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
© The ATHENA Consortium. CI2: The ATHENA Interoperability Framework Module 1: The ATHENA Interoperability Framework.
Rational Unified Process Fundamentals Module 4: Disciplines II.
MDA and QVT  Tom Gullion, Director of Product Management, Together Products.
ATL The ATLAS Transformation Language. 2 ATL (ATLAS Transformation Language) ATL transformation pattern ATL metamodel Helpers – Operation helpers – Attribute.
Chapter 7 Java Server Pages. Objectives Explain how the separation of concerns principle applies to JSP Describe the operation and life-cycle of a JSP.
1 MDWE'2008, Toulouse, France, September 30, 2008 A Comparative Analysis of Transformation Engines for User Interface Development Juan Manuel González.
Tools for Diagrammatic Specifications Stian Skjerveggen Supervisors: Yngve Lamo, Adrian Rutle, Uwe Egbert Wolter.
Model Handling with EMF Eclipse ECESIS Project Model handling with EMF An introduction to the Eclipse Modeling Framework ATLAS group (INRIA & LINA),
Alignment of ATL and QVT © 2006 ATLAS Nantes Alignment of ATL and QVT Ivan Kurtev ATLAS group, INRIA & University of Nantes, France
© The ATHENA Consortium. CI3 - Practices of Interoperability in SMEs Carrier-Shipper Scenario.
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
© The ATHENA Consortium. EM1 - Enterprise Modelling as a way to achieve Interoperability Module 1 - What is Enterprise Modelling?
© The ATHENA Consortium. 6-3b. Atlas Transformation Language (ATL) Tutorial / Exercise,
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
New Perspectives on XML, 2nd Edition
© The ATHENA Consortium. AP6 – Model-Driven Development of Interoperable Web Services, Agents and P2P Solutions Learn about model transformations.
Composition of UML Described Refactoring Rules Presented by Chin-Yi Tsai.
© The ATHENA Consortium. CI2: The ATHENA Interoperability Framework Module 5: Supply Chain Management (SCM) Automotive sector.
© The ATHENA Consortium. EM1 - Enterprise Modelling as a way to achieve Interoperability Module 5 - Enterprise modelling establishment methodology.
An ATL Example © 2005 ATLAS Nantes An ATL Example The BibTeXML to DocBook Transformation ATLAS group (INRIA & LINA), University of Nantes, France.
Adobe Dreamweaver CS3 Revealed CHAPTER SIX: MANAGING A WEB SERVER AND FILES.
1 Innovative Solutions For Mission Critical Systems Using EMF Annotations to Drive Program Behavior February 19, 2014.
Makefiles. Multiple Source Files (1) u Obviously, large programs are not going to be contained within single files. u C provides several techniques to.
1 © AdaCore under the GNU Free Documentation License Franco Gasperoni
CPSC 871 John D. McGregor Change management Module 2 Session 3.
© The ATHENA Consortium. EM1 - Enterprise Modelling as a way to achieve Interoperability Module 3 - What interoperability problems does Enterprise.
Copyright © 2002 Delmar Thomson Learning Chapter 14 Documenting Your PLC System.
Computer Science I Programming in Java (programming using Processing IN Java, using IntelliJ IDE) Classwork/Homework: copy your Processing projects over.
Introduction To Model-to-Model Transformation © 2008 INRIA Introduction To Model-to-Model Transformation Hugo Bruneliere & Frédéric Jouault INRIA.
® IBM Software Group © 2006 IBM Corporation Rational Asset Manager v7.2 Using Scripting Tutorial for using command line and scripting using Ant Tasks Carlos.
These materials are prepared only for the students enrolled in the course Distributed Software Development (DSD) at the Department of Computer.
© The ATHENA Consortium. CI3 - Practices of Interoperability in SMEs Proposed Solutions.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
© The ATHENA Consortium. 5-2b. Eclipse Modeling Framework (EMF) Tutorial / Exercise,
5-4b. Eclipse Process Framework (EPF) Tutorial / Exercise
Towards Automatic Model Synchronization from Model Transformation
Documenting Your PLC System
Metadata The metadata contains
QVT Operational 1.0 Ganymede Simultaneous Release Graduation Review
Software Architecture & Design
Presentation transcript:

Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 6-1b. Atlas Transformation Language (ATL) with RSM Tutorial,

2 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Outline Atlas Transformation Language (ATL) tutorial with RSM example –Installation –Book2Publish example –RSM References

3 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) ATL (1/2) ATL: Atlas Transformation Language Developed by: –LINA (Laboratoire D’Informatique De Nantes Atlantique) –Université de Nantes Faculté des Sciences et Techniques –Building IRIN –2, rue de la Houssinière, BP –44322 Nantes cedex 3, France Proposal to the OMG MOF/QVT RFP. Model transformation language –Hybrid Declarative => transformations based on simple mappings Imperative => for complex mappings –Based on OCL Documentation –

4 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) ATL (2/2) An ATL transformation program is composed of rules that define how –source model elements are matched and navigated –to create and initialize the elements of the target models The ATL programs for model to model transformation are called modules. Composed of –Header transformation name variables of source and target models –Import libraries to be imported –Helpers define (global) variables and functions. –Rules describe the transformation from a source model to a target model

5 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Warning To navigate from an element to its attribute, –write the name of the element, then “.” and the name of the attribute; If an identifier (variable name, metamodel name, model element name, etc.) is in conflict with a keyword, –it has to be marked with apostrophes; The ATL parser is case sensitive. This concerns –the file names –the source code itself.

6 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) ATL: Installation

7 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Installation (1/2) Rational Software Modeler (RSM) 6.0 –Based on Eclipse 3.0 ADT (ATL Development Tools) –Installation guide 1].pdfhttp:// 1].pdf –NB! Download ADT for Eclipse 3.0 and not ogy/gmt/atl/binaries/ADT /adt (Eclipse_3.0).ziphttp:// ogy/gmt/atl/binaries/ADT /adt (Eclipse_3.0).zip Unzip adt (Eclipse_3.0).zip into {RSMInstallDir}\eclipse –C:\Program Files\IBM\Rational\SDP\6.0\eclipse

8 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Installation (2/2) Additional elements to download and install for ADT –External libraries not included as part of the standard ADT package Download antlr jar from – –Rename file to antlr.jar –Copy antlr.jar into … {RSMInstallDir}\eclipse\plugins\org.atl.eclipse.engine _1.0.7\lib Download mdr-standalone.zip from – –Unzip into {RSMInstallDir}\eclipse\plugins\org.atl.engine.reposit ories.mdr4atl_1.0.0\lib The ADT is now installed. In Eclipse it adds –Plug-in –2 perspectives ATL perspective Debug perspective

9 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) ATL: Book2Publish example

10 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Reminder on transformation

11 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Goal Transform instances Book into instances of Publication Sum of chapters' number of pages List of authors'names separated by and

12 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) ATL transformation code Header Helper Rule

13 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Book2Publication.atl Header module Book2Publication; create OUT : Publication from IN : Book;

14 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Helper –To build the authors' list helper context Book!Book def : getAuthors() : String = self.chapters-> collect(e | e.author)-> asSet()-> iterate(authorName; acc : String = '' | acc + if acc = '' then authorName else ' and ' + authorName endif); 1st helper

15 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) helper context Book!Book def : getAuthors() : String = self.chapters-> collect(e | e.author)-> asSet()-> iterate(authorName; acc : String = '' | acc + if acc = '' then authorName else ' and ' + authorName endif); Get the authors of each chapter Suppress duplicated values Select the chapters Build the list

16 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Iterate on a collection To iterate on a collection acc is an accumulator which gets the initial value elem is an iterator which iterates on each element of the collection For each iteration expression-avec-elem-et-acc is –Evaluated –And then put into acc collection->iterate(elem : Type; acc : Type = | expression-avec-elem-et-acc)

17 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 2nd helper Helper –To get the total of pages helper context Book!Book def : getNbPages() : Integer = self.chapters-> collect(f|f.nbPages)-> iterate(pages; acc : Integer = 0 | acc + pages);

18 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Rules rule Book2Publication { from b : Book!Book ( b.getNbPages() > 2 ) to out : Publication!Publication ( title <- b.title, authors <- b.getAuthors(), nbPages <- b.getNbPages() ) }

19 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) ATL: RSM

20 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) RSM example steps 1.Create an ATL project Book2Publication 2.Create the Book.emx metamodel (UML model) 3.Export and import the Book.emx metamodel as Book.ecore 4.Create the Publication.emx metamodel (UML model) 5.Export and import the Publication.emx metamodel as Publication.ecore 6.Create an ATL file Book2Publication.atl 7.Write the ATL transformation 8.Create a source model theBooks.ecore containing book instances 9.Configure the ATL transformation 10.Run the ATL transformation

21 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 1. Create an ATL project

22 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 2a. Create the Book metamodel

23 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 2b. Create the Book metamodel

24 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 2c. Create the Book metamodel

25 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 3a. Export the Book metamodel as.ecore

26 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 3b. Export the Book metamodel as.ecore

27 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 3c. Export the Book metamodel as.ecore

28 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Book.ecore file <ecore:EPackage xmi:version="2.0" xmlns:xmi=" xmlns:xsi=" xmlns:ecore=" name="Book" nsURI=" nsPrefix="Book"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" lowerBound="1" eType="ecore:EDataType defaultValueLiteral=""/> <eStructuralFeatures xsi:type="ecore:EReference" name="chapters" upperBound="-1" eType="#//Chapter" containment="true"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" lowerBound="1" eType="ecore:EDataType defaultValueLiteral=""/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="author" lowerBound="1" eType="ecore:EDataType defaultValueLiteral=""/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="nbPages" lowerBound="1" eType="ecore:EDataType

29 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 3d. Import the Book metamodel as.ecore NB! Choose "File system" If you choose "Ecore Model", RSM proposes to replace your ".emx' model !!!!!!

30 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 3e. Import the Book metamodel as.ecore

31 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 4-5. Create the Publication metamodel and export/import as.ecore Follow the same procedure as for the Book metamodel (steps 2 and 3) to create and export/import the Publication metamodel as.ecore

32 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 6a. Create an ATL file

33 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 6b. Set IN metamodel

34 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 6c. Set OUT metamodel

35 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 7. Write the ATL transformation

36 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 8. Create source model Set of book instances theBooks.ecore <xmi:XMI xmi:version="2.0" xmlns:xmi=" xmlns:Book="

37 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 9a. Configure the ATL transformation

38 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 9b. Configure the ATL transformation Change the name Fill

39 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 9c. Configure the ATL transformation Name of the source model ( IN ) and meta- model ( Book ) The same for the target ( OUT, Publication ) Set the paths IN = source model file ( theBooks.ecore ) Book = source metamodel ( Book.ecore ) OUT = target file ( thePublications.ecore ) Publication = target metamodel ( Publication.ecore )

40 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) 10. Run the ATL transformation

41 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) Result: thePublications.ecore <xmi:XMI xmi:version="2.0" xmlns:xmi=" xmlns:Publication=" <Publication:Publication title="ATL for Dummies" authors="Reyes and Jean-Pierre and Arne" nbPages="50"/> <Publication:Publication title="Easy ATL" authors="Reyes and Jean-Pierre" nbPages="11"/>

42 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) To summarize rule Book2Publication { from b : Book!Book ( b.getNbPages() > 2 ) to out : Publication!Publication ( title <- b.title, authors <- b.getAuthors(), nbPages <- b.getNbPages() ) } <xmi:XMI xmi:version="2.0" xmlns:xmi=" xmlns="Book"> <xmi:XMI xmi:version="2.0" xmlns:xmi=" xmlns="Publication"> <Publication title="ATL for Dummies" nbPages="50" authors="Reyes and Jean-Pierre and Arne"/> <Publication title="Easy ATL" nbPages="11" authors="Reyes and Jean-Pierre"/> >

43 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) References

44 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) References INRIA, "ATL - The Atlas Transformation Language Home Page".

45 Based on material developed in ATHENA (IST ), INTEROP (IST ) and MODELWARE (IST ) This course has been developed under the funding of the EC with the support of the EC ATHENA-IP Project. Disclaimer and Copyright Notice: Permission is granted without fee for personal or educational (non-profit) use, previous notification is needed. For notification purposes, please, address to the ATHENA Training Programme Chair at In other cases please, contact at the same address for use conditions. Some of the figures presented in this course are freely inspired by others reported in referenced works/sources. For such figures copyright and all rights therein are maintained by the original authors or by other copyright holders. It is understood that all persons copying these figures will adhere to the terms and constraints invoked by each copyright