Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [QVTO] Add UML stereotypes in out model
[QVTO] Add UML stereotypes in out model [message #85295] Thu, 26 June 2008 16:11 Go to next message
Eclipse UserFriend
Originally posted by: koen.yskout.cs.kuleuven.be

Hi,

When I create a transformation that needs to generate a UML model and
apply stereotypes from a given profile to its elements, the stereotypes
do not get saved in the resulting .uml file (minimal example of such a
transformation at the end of my post).

Looking at the .uml file with a text editor, the stereotype applications
should appear as siblings of the uml:Model element (and the root should
become an xml:XMI node), but they are not in the file, and the root node
is still uml:Model.

Is this a bug, is it impossible or am I doing something terribly wrong?

Thanks for your help,

Koen


---
/* run with 'pathmap://UML_PROFILES/Standard.profile.uml' for profile */
modeltype UML uses uml;
transformation demo(in profile : UML, out model : UML);
main() {
var stereo := profile.objects()[Stereotype]->any(name = 'Metamodel');
var myModel := object UML::Model {
name := 'myModel';
};
myModel.applyProfile(profile.objects()![Profile]);
log('Applied before?', myModel.isStereotypeApplied(stereo)); /*false*/
myModel.applyStereotype(stereo);
log('Applied after?', myModel.isStereotypeApplied(stereo)); /*true*/
}
---
Re: [QVTO] Add UML stereotypes in out model [message #85371 is a reply to message #85295] Fri, 27 June 2008 13:01 Go to previous messageGo to next message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Koen,

I ran sample you posted and got correct result.

The only line I changed is metamodel decl:
modeltype UML uses uml('http://www.eclipse.org/uml2/2.1.0/UML');

After executing sample output model is:

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
xmi:id="_eHpUwERIEd29r5TrDvwR5w" name="myModel">
<profileApplication xmi:id="_eHpUwURIEd29r5TrDvwR5w">
<eAnnotations xmi:id="_eHpUwkRIEd29r5TrDvwR5w"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
</eAnnotations>
<appliedProfile href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
</profileApplication>
</uml:Model>


I'm using latest QVTO build from
http://www.eclipse.org/modeling/m2m/downloads/index.php?proj ect=qvtoml

Looks like something wrong in your environment.

Regards,
Sergey.

Koen Yskout wrote:
> Hi,
>
> When I create a transformation that needs to generate a UML model and
> apply stereotypes from a given profile to its elements, the stereotypes
> do not get saved in the resulting .uml file (minimal example of such a
> transformation at the end of my post).
>
> Looking at the .uml file with a text editor, the stereotype applications
> should appear as siblings of the uml:Model element (and the root should
> become an xml:XMI node), but they are not in the file, and the root node
> is still uml:Model.
>
> Is this a bug, is it impossible or am I doing something terribly wrong?
>
> Thanks for your help,
>
> Koen
>
>
> ---
> /* run with 'pathmap://UML_PROFILES/Standard.profile.uml' for profile */
> modeltype UML uses uml;
> transformation demo(in profile : UML, out model : UML);
> main() {
> var stereo := profile.objects()[Stereotype]->any(name = 'Metamodel');
> var myModel := object UML::Model {
> name := 'myModel';
> };
> myModel.applyProfile(profile.objects()![Profile]);
> log('Applied before?', myModel.isStereotypeApplied(stereo)); /*false*/
> myModel.applyStereotype(stereo);
> log('Applied after?', myModel.isStereotypeApplied(stereo)); /*true*/
> }
> ---
Re: [QVTO] Add UML stereotypes in out model [message #85386 is a reply to message #85371] Fri, 27 June 2008 13:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: koen.yskout.cs.kuleuven.be

I get the same result. However, the myModel element is not stereotyped
with the 'Metamodel' stereotype.

The expected structure of the result is as follows (obtained by
stereotyping manually using the UML editor):

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:Standard="http://www.eclipse.org/uml2/schemas/Standard/1"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Standard/1
pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w">
<uml:Model xmi:id="_Qa7OsEObEd2ILLVSvdBKHA" name="myModel">
<profileApplication xmi:id="_Qa7OsUObEd2ILLVSvdBKHA">
<eAnnotations xmi:id="_Qa7OskObEd2ILLVSvdBKHA"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
</eAnnotations>
<appliedProfile
href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
</profileApplication>
</uml:Model>
<Standard:Metamodel xmi:id="_aDB94ERKEd2j5e9SZqPV4w"
base_Model="_Qa7OsEObEd2ILLVSvdBKHA"/>
</xmi:XMI>

Notice that the stereotype application is at the same level as the
uml:Model element. It seems as if the transformation seems not to
serialize it correctly.

The problem seems related to the one described in the thread
"[QVTO]Incompatible input type 'modelparam::ResourceEObject', expected
'uml::Model'", but then in the other direction.

Koen

Sergey Boyko wrote:
> Hi Koen,
>
> I ran sample you posted and got correct result.
>
> The only line I changed is metamodel decl:
> modeltype UML uses uml('http://www.eclipse.org/uml2/2.1.0/UML');
>
> After executing sample output model is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Model xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xmi:id="_eHpUwERIEd29r5TrDvwR5w" name="myModel">
> <profileApplication xmi:id="_eHpUwURIEd29r5TrDvwR5w">
> <eAnnotations xmi:id="_eHpUwkRIEd29r5TrDvwR5w"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
>
> </eAnnotations>
> <appliedProfile href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
> </profileApplication>
> </uml:Model>
>
>
> I'm using latest QVTO build from
> http://www.eclipse.org/modeling/m2m/downloads/index.php?proj ect=qvtoml
>
> Looks like something wrong in your environment.
>
> Regards,
> Sergey.
>
> Koen Yskout wrote:
>> Hi,
>>
>> When I create a transformation that needs to generate a UML model and
>> apply stereotypes from a given profile to its elements, the
>> stereotypes do not get saved in the resulting .uml file (minimal
>> example of such a transformation at the end of my post).
>>
>> Looking at the .uml file with a text editor, the stereotype
>> applications should appear as siblings of the uml:Model element (and
>> the root should become an xml:XMI node), but they are not in the file,
>> and the root node is still uml:Model.
>>
>> Is this a bug, is it impossible or am I doing something terribly wrong?
>>
>> Thanks for your help,
>>
>> Koen
>>
>>
>> ---
>> /* run with 'pathmap://UML_PROFILES/Standard.profile.uml' for profile */
>> modeltype UML uses uml;
>> transformation demo(in profile : UML, out model : UML);
>> main() {
>> var stereo := profile.objects()[Stereotype]->any(name = 'Metamodel');
>> var myModel := object UML::Model {
>> name := 'myModel';
>> };
>> myModel.applyProfile(profile.objects()![Profile]);
>> log('Applied before?', myModel.isStereotypeApplied(stereo)); /*false*/
>> myModel.applyStereotype(stereo);
>> log('Applied after?', myModel.isStereotypeApplied(stereo)); /*true*/
>> }
>> ---
Re: [QVTO] Add UML stereotypes in out model [message #85398 is a reply to message #85386] Fri, 27 June 2008 15:18 Go to previous message
Sergey Boyko is currently offline Sergey BoykoFriend
Messages: 171
Registered: July 2009
Senior Member
Hi Koen,

Debugging shows that there's limitation in our impl. that UML stereotype
operations rely on.

I've opened CR for that https://bugs.eclipse.org/bugs/show_bug.cgi?id=238805


Regards,
Sergey.


Koen Yskout wrote:
> I get the same result. However, the myModel element is not stereotyped
> with the 'Metamodel' stereotype.
>
> The expected structure of the result is as follows (obtained by
> stereotyping manually using the UML editor):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:Standard="http://www.eclipse.org/uml2/schemas/Standard/1"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xsi:schemaLocation="http://www.eclipse.org/uml2/schemas/Standard/1
> pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w">
> <uml:Model xmi:id="_Qa7OsEObEd2ILLVSvdBKHA" name="myModel">
> <profileApplication xmi:id="_Qa7OsUObEd2ILLVSvdBKHA">
> <eAnnotations xmi:id="_Qa7OskObEd2ILLVSvdBKHA"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
>
> </eAnnotations>
> <appliedProfile
> href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
> </profileApplication>
> </uml:Model>
> <Standard:Metamodel xmi:id="_aDB94ERKEd2j5e9SZqPV4w"
> base_Model="_Qa7OsEObEd2ILLVSvdBKHA"/>
> </xmi:XMI>
>
> Notice that the stereotype application is at the same level as the
> uml:Model element. It seems as if the transformation seems not to
> serialize it correctly.
>
> The problem seems related to the one described in the thread
> "[QVTO]Incompatible input type 'modelparam::ResourceEObject', expected
> 'uml::Model'", but then in the other direction.
>
> Koen
>
> Sergey Boyko wrote:
>> Hi Koen,
>>
>> I ran sample you posted and got correct result.
>>
>> The only line I changed is metamodel decl:
>> modeltype UML uses uml('http://www.eclipse.org/uml2/2.1.0/UML');
>>
>> After executing sample output model is:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <uml:Model xmi:version="2.1"
>> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
>> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
>> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
>> xmi:id="_eHpUwERIEd29r5TrDvwR5w" name="myModel">
>> <profileApplication xmi:id="_eHpUwURIEd29r5TrDvwR5w">
>> <eAnnotations xmi:id="_eHpUwkRIEd29r5TrDvwR5w"
>> source="http://www.eclipse.org/uml2/2.0.0/UML">
>> <references xmi:type="ecore:EPackage"
>> href=" pathmap://UML_PROFILES/Standard.profile.uml#_yzU58YinEdqtvbn fB2L_5w"/>
>>
>> </eAnnotations>
>> <appliedProfile
>> href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
>> </profileApplication>
>> </uml:Model>
>>
>>
>> I'm using latest QVTO build from
>> http://www.eclipse.org/modeling/m2m/downloads/index.php?proj ect=qvtoml
>>
>> Looks like something wrong in your environment.
>>
>> Regards,
>> Sergey.
>>
>> Koen Yskout wrote:
>>> Hi,
>>>
>>> When I create a transformation that needs to generate a UML model and
>>> apply stereotypes from a given profile to its elements, the
>>> stereotypes do not get saved in the resulting .uml file (minimal
>>> example of such a transformation at the end of my post).
>>>
>>> Looking at the .uml file with a text editor, the stereotype
>>> applications should appear as siblings of the uml:Model element (and
>>> the root should become an xml:XMI node), but they are not in the
>>> file, and the root node is still uml:Model.
>>>
>>> Is this a bug, is it impossible or am I doing something terribly wrong?
>>>
>>> Thanks for your help,
>>>
>>> Koen
>>>
>>>
>>> ---
>>> /* run with 'pathmap://UML_PROFILES/Standard.profile.uml' for profile */
>>> modeltype UML uses uml;
>>> transformation demo(in profile : UML, out model : UML);
>>> main() {
>>> var stereo := profile.objects()[Stereotype]->any(name = 'Metamodel');
>>> var myModel := object UML::Model {
>>> name := 'myModel';
>>> };
>>> myModel.applyProfile(profile.objects()![Profile]);
>>> log('Applied before?', myModel.isStereotypeApplied(stereo)); /*false*/
>>> myModel.applyStereotype(stereo);
>>> log('Applied after?', myModel.isStereotypeApplied(stereo)); /*true*/
>>> }
>>> ---
Previous Topic:[ATL] New vs Old Launch Configurations and Ganymede Missing Features
Next Topic:[ATL] Setting details of EAnnotations or maps in general
Goto Forum:
  


Current Time: Thu Mar 28 18:03:30 GMT 2024

Powered by FUDForum. Page generated in 0.03673 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top