To jest stara wersja strony!


Opis

Marek Mierzwa, mierzwa.marek@gmail.com Jakub Ostrowski, kubaostrowski@gmail.com

How we could use Atlas for ARD, XTT, design and integration? ATL: Atlas Transformation…. eclipse

  • input
  • output

Spotkania

08.02.26

  • szto eta atlas? demo

08.03.11

  • model ARD w ATL

080318

  • próba opisu całego ARD z TPH przy pomocy HML jako p. wyjścia dla XMI

080401

  • co to jest XMI? jakie ogr. nakłada specyfikacja
  • jak stworzyć model XMI dla ARD (opierając się na HML)
  • zrobić KM3 dla ARD

080603

  • trans?

Projekt

  • przyklad kodu KM3 (Source Metamodel)
 package ARD {
 
	class Wlasnosc {
 
		attribute name : String;
 
		reference atrybuty[*] container : Atrybut opposite of wlasnocAtrybut;
 
		reference dependency container : Wlasnosc opposite of dependencyAtrybut;
 
		reference dependencyWlasnosc[*] : Wlasnosc opposite of dependency;
	}
 
	class Atrybut {
 
		attribute name : String;
 
		reference wlasnoscAtrybut[0-1] : Wlasnosc opposite of atrybuty;
	}
}
 
package Primitive Types {
 
	datatype String;
}
  • kod XMI (Source Model) (the lowest level)
<Ard name="thermostat">

	<property name="month"/>

	<property name="day"/>

	<property name="hour"/>

	<property name="today">

		<dependency name="day"/>

	</property>

	<property name="operation">

		<dependency name="today"/>

		<dependency name="hour"/>

	</property>
	...
</Ard>
  • opis ARD z TPH przy pomocy HML jako p. wyjścia dla XMI
<hml name = "termostat">
	<attribute_set> 
		<att name = "thermostat" id = "att_0"/>
		<att name = "time" id = "att_1"/>
		<att name = "temperature" id = "att_2"/>
		<att name = "date" id = "att_3"/>
		<att name = "thermostat_settings" id = "att_4"/>
		<att name = "operation" id = "att_5"/>
		<att name = "season" id = "att_6"/>
		<att name = "today" id = "att_7"/>
		<att name = "hour" id = "att_8"/>
		<att name = "month" id = "att_9"/>
		<att name = "day" id = "att_10"/>					
	</attribute_set>
	
	<property_set>
		<property name = "thermostat_pr" id="prp_0">
			<attref ref = "att_0"/>
		</property>
		<property name = "time_temp_pr" id="prp_1">
			<attref ref = "att_1"/>
			<attref ref = "att_2"/>
		</property>
		<property name = "time_pr" id="prp_2">
			<attref ref = "att_1"/>
		</property>
		<property name = "temperature" id="prp_3">
			<attref ref = "att_2"/>
		</property>
		<property name = "date_hour_seasion_operation_pr" id="prp_4">
			<attref ref = "att_3"/>
			<attref ref = "att_8"/>
			<attref ref = "att_6"/>
			<attref ref = "att_5"/>
		</property>
		<property name = "date_hour_pr" id="prp_5">
			<attref ref = "att_3"/>
			<attref ref = "att_8"/>
		</property>
		<property name = "season_operation_pr" id="prp_6">
			<attref ref = "att_6"/>
			<attref ref = "att_5"/>
		</property>
		<property name = "day_month_today_pr" id="prp_7">
			<attref ref = "att_10"/>
			<attref ref = "att_9"/>
			<attref ref = "att_7"/>
		</property>
		<property name = "day_today_pr" id="prp_8">
			<attref ref = "att_10"/>
			<attref ref = "att_7"/>
		</property>	
		<property name = "thermostat_settings_pr" id="prp_9">
			<attref ref = "att_0"/>
		</property>
		<property name = "operation_pr" id="prp_10">
			<attref ref="att_1"/>
	        </property>
		<property name = "season_pr" id="prp_11">
			<attref ref="att_2"/>
	        </property>
		<property name = "today_pr" id="prp_12">
		    <attref ref="att_3"/>
		</property>
		<property name = "hour_pr" id="prp_13">
		    <attref ref="att_4"/>
		</property>
		<property name = "month_pr" id = "prp_14">
			<attref ref = "att_5"/>
		</property>
		<property name = "day_pr" id = "prp_15">
			<attref ref = "att_6"/>
		</property>
		<property name = "date" id = "prp_16">
			<attref ref = "att_3"/>
		</property>
	</property_set>
		
	<tph>
    	        <trans src="prp_0" dst="prp_1"/>
		<trans src="prp_1" dst="prp_2"/>
		<trans src="prp_1" dst="prp_3"/>
		<trans src="prp_2" dst="prp_4"/>
		<trans src="prp_3" dst="prp_9"/>
		<trans src="prp_4" dst="prp_5"/>
		<trans src="prp_4" dst="prp_6"/>
		<trans src="prp_5" dst="prp_13"/>
		<trans src="prp_5" dst="prp_16"/>
		<trans src="prp_6" dst="prp_10"/>
		<trans src="prp_6" dst="prp_11"/>
		<trans src="prp_16" dst="prp_7"/>
		<trans src="prp_7" dst="prp_14"/>
		<trans src="prp_7" dst="prp_8"/>
		<trans src="prp_8" dst="prp_15"/>
		<trans src="prp_8" dst="prp_12"/>
	</tph>
	
	<ard>
    	        <dep independent="prp_15" dependent="prp_12"/>
		<dep independent="prp_14" dependent="prp_11"/>
		<dep independent="prp_13" dependent="prp_10"/>
		<dep independent="prp_12" dependent="prp_10"/>
		<dep independent="prp_10" dependent="prp_9"/>
		<dep independent="prp_11" dependent="prp_9"/>
        </ard>
</hml>
  • KM3 (opis ARD z TPH przy pomocy HML)
package HML {
	abstract class Node {
		reference parent[0-1] : Element oppositeOf children;
	}
	class Element {
		reference children[*] ordered container : Node oppositeOf parent;
	}
//Ard
	class Ard extends Node {
	}
	class Dep extends Element {
		attribute independent : String;
		attribute dependent : String;
	}
//Tph
	class Tph extends Node {
	}
	class Trans extends Element {
		attribute src : String;
		attribute dst : String;
	}
//Property_set
	class Property_set extends Node {	//czy bez extends, bo reference ma byc do Property a nie Element
						// (a moze moze zostac, bo Property dziedziczy z Element?)?
	}
	class Property extends Element {
		attribute name : String;
		attribute id : String;
		reference parent[0-1] : Element oppositeOf children;
	}
	class Attref extends Element {
		attribute ref : String;
	}
//Attribute_set
	class Attribute_set extends Node {
	}
	class Att extends Element {
		attribute name : String;
		attribute id : String;
	}

}

package PrimitiveTypes {
	datatype Boolean;
	datatype Integer;
	datatype String;
}
  • Metamodel ARD (w oparciu o HML)

:pl:miw:ard.png

  • Metamodel ARD KM3
package Hml {
	abstract class Node {
		reference children[*] container : Element oppositeOf parent;
	}
	
	class Element {	
		attribute id : String;
		reference parent : Node oppositeOf children;
	}
	
	-- Type set
	
	class Type_set extends Node {
	}

	-- ARD
	
	class Ard extends Node {
	}
	class Dep extends Element {
		attribute independent : String;
		attribute dependent : String;
	}
	
	-- TPH
	
	class Tph extends Node {
	}
	class Trans extends Element {
		attribute src : String;
		attribute dst : String;
	}
	
	-- Property set
	
	class Property_set extends Node {						
	}
	class Property extends Element {
		reference attributes[*] container : Attref oppositeOf properties;
	}
	class Attref {
		attribute ref : String;
		reference properties[0-1] : Property oppositeOf attributes;
	}
	
	--Attributes set
	
	class Attribute_set extends Node {
	}
	class Att extends Element {
		attribute name : String;
	}
}
	
package PrimitiveTypes {
	datatype String;
}
  • Metamodel ARD XMI
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
  <ecore:EPackage name="Hml">
    <eClassifiers xsi:type="ecore:EClass" name="Node" abstract="true">
      <eStructuralFeatures xsi:type="ecore:EReference" name="children" ordered="false" upperBound="-1" eType="/0/Element" containment="true" eOpposite="/0/Element/parent"/>
    </eClassifiers>
    <eClassifiers xsi:type="ecore:EClass" name="Element">
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
      <eStructuralFeatures xsi:type="ecore:EReference" name="parent" ordered="false" lowerBound="1" eType="/0/Node" eOpposite="/0/Node/children"/>
    </eClassifiers>
    <eClassifiers xsi:type="ecore:EClass" name="Type_set" eSuperTypes="/0/Node"/>
    <eClassifiers xsi:type="ecore:EClass" name="Ard" eSuperTypes="/0/Node"/>
    <eClassifiers xsi:type="ecore:EClass" name="Dep" eSuperTypes="/0/Element">
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="independent" ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="dependent" ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
    </eClassifiers>
    <eClassifiers xsi:type="ecore:EClass" name="Tph" eSuperTypes="/0/Node"/>
    <eClassifiers xsi:type="ecore:EClass" name="Trans" eSuperTypes="/0/Element">
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="src" ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="dst" ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
    </eClassifiers>
    <eClassifiers xsi:type="ecore:EClass" name="Property_set" eSuperTypes="/0/Node"/>
    <eClassifiers xsi:type="ecore:EClass" name="Property" eSuperTypes="/0/Element">
      <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" ordered="false" upperBound="-1" eType="/0/Attref" containment="true" eOpposite="/0/Attref/properties"/>
    </eClassifiers>
    <eClassifiers xsi:type="ecore:EClass" name="Attref">
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="ref" ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
      <eStructuralFeatures xsi:type="ecore:EReference" name="properties" ordered="false" eType="/0/Property" eOpposite="/0/Property/attributes"/>
    </eClassifiers>
    <eClassifiers xsi:type="ecore:EClass" name="Attribute_set" eSuperTypes="/0/Node"/>
    <eClassifiers xsi:type="ecore:EClass" name="Att" eSuperTypes="/0/Element">
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" ordered="false" unique="false" lowerBound="1" eType="/1/String"/>
    </eClassifiers>
  </ecore:EPackage>
  <ecore:EPackage name="PrimitiveTypes">
    <eClassifiers xsi:type="ecore:EDataType" name="String"/>
  </ecore:EPackage>
</xmi:XMI>

Sprawozdanie

W związku z tym że instalacja środowiska ATL okazała się znacznie trudniejsza niż przypuszczaliśmy i samo doprowadzenie oprogramowania do pełnej funkcjonalności zajęło nam około tydzień i kosztowało wiele nerwów, chcielibyśmy podzielić się wrażeniami i opinią na temat aktualnej wersji ATL.

Chcielibyśmy zacząć od tego że sam pakiet instalacyjny dostępny na oficjalnej stronie ATL w formie skompilowanych pluginów do środowiska Eclipse (http://www.eclipse.org/modeling/m2m/downloads/index.php?project=atl) jest niekompletny. Wprawdzie dostępne pluginy umożliwiają dokonanie transformacji, ale brakuje jednej z kluczowych funkcjonalności polegającej na wygenerowaniu pliku ECORE (XMI) z KM3. W tej sytuacji dostępne oprogramowanie może służyć głównie do korzystania z gotowych transformacji dostępnych na stronie ATL (http://www.eclipse.org/m2m/atl/atlTransformations/), zaś tworzenie własnych transformacji jest bardzo utrudnione, gdyż jesteśmy zmuszeni do własnoręcznego napisania meta-modelu w XMI , co w ogóle podważa celowość wykorzystania KM3 którego funkcja polega właśnie na tym żeby móc w sposób łatwy (korzystając z języka zbliżonego do JAVA) zaprojektować meta-model. Jednak nie sam brak owej funkcjonalności jest najbardziej rażący.

To co najbardziej irytuje, to dokumentacja do środowiska. Otóż nie ma w niej słowa o powyższych brakach. W oficjalnym poradniku dla początkujących (http://www.eclipse.org/m2m/atl/doc/ATL_Starter_Guide.pdf) jest opisane krok po kroku jak stworzyć prosty projekt korzystając z „nieistniejących” funkcjonalności. Rady dotyczące konfiguracji oraz zamieszczone screenshoty ni jak się maja do tego, co przedstawia ATL w swej aktualnej wersji. Dodam ze instalację przeprowadziliśmy zgodnie z poradnikiem (http://www.eclipse.org/m2m/atl/doc/ATL_Installation_Guide[v0.1].pdf) ściągając i instalując wszystkie niezbędne składniki. Otóż jak się później okazało, aby ATL było w pełni funkcjonalne należy zainstalować 2 dodatkowe pakiety: AM3 (ATLAS MegaModel Management) i TCS (Textual Concrete Syntax) niewymienione w poradniku instalacyjnym.

AM3 w formie skompilowanej jest dostępne ze strony http://www.eclipse.org/gmt/am3/download/ jednak jak się okazało po lekturze Eclipse Newsgroups również nie jest w wersji kompletnej. Pewne kluczowe pluginy dostępne są tylko w formie źródeł do ściągnięcia z repozytorium CVS. Jeśli chodzi o TCS to żadne pliki w wersji binarnej nie są dostępne, jedyne co mamy do dyspozycji to pliki źródłowe z CVS. Nie było by to problemem gdyby nie to, że po ściągnięciu odpowiednich pluginów w formie źródeł(zgodnie z http://wiki.eclipse.org/AM3/How_Install_AM3_From_CVS i http://wiki.eclipse.org/TCS/Language_Project) niektóre pluginy nie dają się skompilować. Jak się okazało nie tylko my mieliśmy z tym problem http://dev.eclipse.org/newslists/news.eclipse.modeling.gmt/msg00642.html ). Wygląda na to że aktualna wersja owych pluginów nie jest odpowiednio zintegrowana z dostępną wersją ATL bądź z innymi składnikami. Kompilator zgłasza błędy związane z brakiem pewnych klas (które nota bene środowisko Eclipse wykrywa jako zaimportowane czyli dostępne dla projektów w „strefie roboczej”) Po odnalezieniu i zaimportowaniu odpowiednich klas bezpośrednio do projektów i wielogodzinnym debugowaniu (opierając się na lekturze grupy dyskusyjnej m.in.- http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/msg02427.html)ostatecznie udało nam się skompilować i zbudować wszystkie niezbędne pluginy.

Po instalacji opcja „Inject KM3 to Ecore metamodel” pojawiła się w menu kontekstowym jednak jak się okazało później nie działała jak należy. Operacja generuje plik ECORE zawierający jedynie nagłówek XMI i nic poza tym. Próby instalacji powyższych pakietów w innych wersjach środowiska Eclipse również zakończyły się fiaskiem. Prawdopodobnie popadlibyśmy w rezygnacje gdyby nie odnalezienie postu, w którym autor zamieszcza link do pakietu ATL/AM3/TCS w wersjach binarnych (jak sam zaznacza „zagubiony w sieci” gdyż nigdzie nie było do niego odnośnika - http://dev.eclipse.org/newslists/news.eclipse.modeling.tmf/msg00175.html) Po niewielkiej modyfikacji udało nam się uruchomić pakiet, który jak na razie działa jak należy.

Podsumowując, aktualnie nie istnieje żaden skuteczny poradnik jak zainstalować ATL. Mamy wątpliwości czy w ogóle jest to możliwe korzystając tylko z aktualnych źródeł zamieszczonych w repozytorium CVS. Pliki w dziale downoload nie zawierają wszystkim potrzebnych pluginów. Dokumentacja do środowiska jest niespójna i niekompletna. Frédéric Jouault - jeden z developerów ATL przyznaje że trwają prace nad poprawą sytuacji (http://dev.eclipse.org/newslists/news.eclipse.modeling.gmt/msg00621.html), jednakże do chwili obecnej problem nie został rozwiązany.

Materiały

pl/miw/miw08_hekateatl.1222782233.txt.gz · ostatnio zmienione: 2019/06/27 15:58 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0