|Re: Using ETL transform models which are based on UML Profiles [message #857669 is a reply to message #593538]
||Thu, 26 April 2012 19:05
|| Horacio Hoyos
Registered: October 2009
I have worked with transformations from SysML (an UML profile) models to other models. I have worked with TopCased and Papyrus SysML models. In both cases, I had access to the SysML metamodel provided by the tools. Having the metamodel any m2m or m2t transformation can be easily implemented.
In the case of Papyrus, when you apply your own profile to a UML/SysML model, two things happen. 1. A profileApplication attribute is added to your model, as in:
<eAnnotations xmi:id="_OL7wwGbvEeGL2_MC6R8Gvg" source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="../../co.edu.uniandes.hiles.sysml/src/co/edu/uniandes/hiles/sysml/model/HiLeS.profile.uml#_6MuSEGxZEeGiq_VG-MNlIg"/>
2. When you apply a stereotype to an element in your model a new element is added to it. The elements's type is of the applied stereotype and, in Papyrus, this element has a reference to the element to which te stereotype was applied:
<packagedElement xmi:type="uml:Class" xmi:id="_MAmskAp0EeGpeNcMa-nVxQ" name="Level Calculator">
<MyProfile:FunctionalBlock xmi:id="_bxb-AG1OEeGIv-9deNiXoQ" base_Class="_MAmskAp0EeGpeNcMa-nVxQ"/>
in the example above I applied the FunctionalBock stereotype to the LevelCalculator class. You can see that the FunctionalBlock element has a base_Class attribute that points to the LevelCalculator class.
The papyrus metamodel can be found in the org.eclipse.papyrus.sysml plugin. You can import this plugin to your workspace to have access to it or access the Papyrus repository.
For different type of editors you would need to know/have the metamodel used to describe the models generated by the editor.
As a final word, for example in Papyrus a "Model Explorer" view is provided to see a tree representation of the model we are defining in the editors. When coding your transformations use ths view as a guide because it is that, a view. The correct relations and relation names come from the metamodel.
Horacio Hoyos Rodriguez
University Of York
Powered by FUDForum
. Page generated in 0.01541 seconds