[QVTr] Is it impossible to create a profileApplication in QVT Relation Language? [message #677173] |
Tue, 07 June 2011 19:15 |
Sabine Mueller Messages: 2 Registered: June 2011 |
Junior Member |
|
|
Hi,
by using QVT Relation language (QVT R) I would like to apply a profile in a transformation. Therefore I need to create some code in this way:
<xmi:XMI xmi:version="2.1" xmlns:xmi=" //schema.omg.org/spec/XMI/2.1" xmlns:xsi=" //www.w3.org/2001/XMLSchema-instance" xmlns:MyProfile=" ///schemas/MyProfile/_jIh_MEE2EeCEN_hYm6Ct-Q/99" xmlns:ecore=" //www.eclipse.org/emf/2002/Ecore" xmlns:uml=" //www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation=" ///schemas/MyProfile/_jIh_MEE2EeCEN_hYm6Ct-Q/99 ../Model/ProfileModels/MyProfile.uml#_jIj0YEE2EeCEN_hYm6Ct-Q">
<uml:Model xmi:id="_qb8akM37EdqwVrslYOdUDA">
<!-- ... -->
<profileApplication xmi:id="_DC760IwsEeCVgu6ZKnAeAA">
<eAnnotations xmi:id="_DC760YwsEeCVgu6ZKnAeAA" source="h ttp://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="../Model/ProfileModels/MyProfile.uml#_jIj0YEE2EeCEN_hYm6Ct-Q"/>
</eAnnotations>
<appliedProfile href="../Model/ProfileModels/MyProfile.uml#_XkGiwB07Ed-QQ4mYkrb7Gg"/>
</profileApplication>
<!-- ... -->
</uml:Model>
</xmi:XMI>
To me it seem impossible to create this code by using QVT-R. Here is why:
1. I don't have a chance to add the xsi:schemaLocation attribute to element <xmi:XMI>, i.e. xsi:schemaLocation="[...]/schemas/MyProfile/_jIh_MEE2EeCEN_hYm6Ct-Q/99 ../Model/ProfileModels/MyProfile.uml#_jIj0YEE2EeCEN_hYm6Ct-Q"
2. There is no way to access a href-Property for references (i.e. href="../Model/ProfileModels/MyProfile.uml#_jIj0YEE2EeCEN_hYm6Ct-Q") and appliedProfile (i.e. href="../Model/ProfileModels/MyProfile.uml#_XkGiwB07Ed-QQ4mYkrb7Gg").
Maybe no. 1 is only a problem when using Topcased, so even solving no. 2 would be most helpful. The following QVT relation (for EMF 2.5) results in code that is close to a solution in no. 2, but it still lacks the href. Href is not supported in by UML-Metamodel.
relation profileApplication
{
enforce domain target mdl : uml::Model
{
profileApplication = pa : uml::ProfileApplication {
eAnnotations = doc : ecore::EAnnotation {
source = ' //www.eclipse.org/uml2/2.0.0/UML',
references = set : ecore::EPackage {
-- no way to set href-property
}
},
appliedProfile = prof : uml::Profile {
-- no way to set href-property
}
}
};
}
Results in:
<uml:Model>
<!-- ... -->
<profileApplication xmi:id="_vDV3UCMZEeCZ7MQ24lstxw" appliedProfile="_vDWeYCMZEeCZ7MQ24lstxw">
<eAnnotations xmi:id="_vDV3UiMZEeCZ7MQ24lstxw" source=" //www.eclipse.org/uml2/2.0.0/UML" references="_vDV3VCMZEeCZ7MQ24lstxw"/>
</profileApplication>
</uml:Model>
<ecore:EPackage xmi:id="_vDV3VCMZEeCZ7MQ24lstxw" name="MyProfile"/>
<uml:Profile xmi:id="_vDWeYCMZEeCZ7MQ24lstxw" name="MyProfile"/>
<!-- ... -->
Using EMF 2.6 the relation above fails, because for any reason references are now EObjects. But this does not make it easier.
Has anyone an idea or any suggestion how to apply a profile using QVT Relation Language (QVT R)?
(The same is discussed for QVT Operational Language (QVT O) is solved in this post, but can not be applied in QVT R: www.eclipse.org/forums/index.php/mv/msg/32162/104316/#msg_104316)
Thanks a lot,
Sabine
|
|
|
|
|
Re: (no subject) [message #753653 is a reply to message #677186] |
Fri, 28 October 2011 08:19 |
Siegfried Nolte Messages: 48 Registered: August 2009 |
Member |
|
|
Hi Sabine, Ed, folks,
I came to this discussion from the medini forum, where I learned a bit about it from a guy named "Thomas". Generally applying profiles to models within M2M transformations should be possible. I did it for myself with Eclipse QVT-O. My presentation at a last year's GI Workshop ("Informatik2010") covered it in a bit. The presentation and the sample project (GI2010/qvt/OM/MVC.qvto), both in german, are to be fond on my website (http://www.siegfried-nolte.de/GI2010/GI2010.html, see the GI2010.zip). So the Eclipse's UML metamodel representation and the profile operations (applyProfile, applyStereotype) included in there do it.
Pitily the declarative MVC.qvt is missing. I will try to prepare an example with QVT-R as well. Though I learned from Thomas, that he wants to go a step further and create an UML profile dynamically with a M2M transformation. First I thought it to be easy but now I'm convinced, that it isn't.
Yet it must be possible with diving a bit deeper into the metamodel. So we have to continue discussing in a while.
See you,
Siegfried
[Updated on: Fri, 28 October 2011 09:58] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03809 seconds