Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » uml:Association disappears in ecore model generated from uml2
uml:Association disappears in ecore model generated from uml2 [message #474744] Mon, 30 July 2007 19:02 Go to next message
Eclipse User
Originally posted by: i_j_e_x_a.yahoo.co.jp

Hi.

I have just started writing a simple UML model
(by using TOPCASED TOOLS) and convert it to
ecore. A problem I met is that a UML element
of Association is not converted to an EMF element
but it just disappears.


The model is really simple. There's two classes
(say Class1 and Class2) and they have an association
between them. (*)

In order to convert it to ecore model, I used the
eclipse (3.3) wizard to create a new EMF model from UML.
In the generated .ecore file (**), there's no element
(I expect EReference obviously) which is converted
from the uml:Association.

I guess uml:Association should be converted to
ecore:EReference in the procedure and there was
something wrong somewhere.

Please let me know how to do correctly.

Thanks in advance.


(*) The association is serialized like the following.
(The "xmi:id"s are converted by hand for this message.)

<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
xmi:id="_A" name="Test02_model">
<packagedElement xmi:type="uml:Package" xmi:id="_B" name="Test02_pkg">
<packagedElement xmi:type="uml:Class" xmi:id="_C" name="Class1"/>
<packagedElement xmi:type="uml:Class" xmi:id="_D" name="Class2"/>
<packagedElement xmi:type="uml:Association" xmi:id="_E"
name="Class1-Class2" memberEnd="_F _G" navigableOwnedEnd="_F _G">
<ownedEnd xmi:id="_F" name="source" type="_C" isUnique="false"
association="_E">
<upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_H" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_I" value="1"/>
</ownedEnd>
<ownedEnd xmi:id="_G" name="target" type="_D"
isUnique="false" association="_E">
<upperValue xmi:type="uml:LiteralUnlimitedNatural"
xmi:id="_J" value="1"/>
<lowerValue xmi:type="uml:LiteralInteger"
xmi:id="_K" value="1"/>
</ownedEnd>
</packagedElement>
</packagedElement>
</uml:Model>


(**) Here's the generated .ecore file.

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage 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"
name="Test02_model"
nsURI="http:///Test02_model.ecore" nsPrefix="Test02_model">
<eSubpackages name="Test02_pkg"
nsURI="http:///Test02_model/Test02_pkg.ecore"
nsPrefix="Test02_model.Test02_pkg">
<eClassifiers xsi:type="ecore:EClass" name="Class1"/>
<eClassifiers xsi:type="ecore:EClass" name="Class2"/>
</eSubpackages>
</ecore:EPackage>
Re: uml:Association disappears in ecore model generated from uml2 [message #474745 is a reply to message #474744] Mon, 30 July 2007 19:37 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
Toshinao,

Both of the association ends are owned by the association, which means that
when the model is mapped to EMOF (Ecore), the properties will be lost. In
order to preserve an association end, the property representing it needs to
be owned by the end type (i.e. the class).

Kenn

"Toshinao Ishii" <i_j_e_x_a@yahoo.co.jp> wrote in message
news:f8lckb$lj6$1@build.eclipse.org...
> Hi.
>
> I have just started writing a simple UML model
> (by using TOPCASED TOOLS) and convert it to
> ecore. A problem I met is that a UML element
> of Association is not converted to an EMF element
> but it just disappears.
>
>
> The model is really simple. There's two classes
> (say Class1 and Class2) and they have an association
> between them. (*)
>
> In order to convert it to ecore model, I used the
> eclipse (3.3) wizard to create a new EMF model from UML.
> In the generated .ecore file (**), there's no element
> (I expect EReference obviously) which is converted
> from the uml:Association.
>
> I guess uml:Association should be converted to
> ecore:EReference in the procedure and there was
> something wrong somewhere.
>
> Please let me know how to do correctly.
>
> Thanks in advance.
>
>
> (*) The association is serialized like the following.
> (The "xmi:id"s are converted by hand for this message.)
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Model xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xmi:id="_A" name="Test02_model">
> <packagedElement xmi:type="uml:Package" xmi:id="_B" name="Test02_pkg">
> <packagedElement xmi:type="uml:Class" xmi:id="_C" name="Class1"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_D" name="Class2"/>
> <packagedElement xmi:type="uml:Association" xmi:id="_E"
> name="Class1-Class2" memberEnd="_F _G" navigableOwnedEnd="_F _G">
> <ownedEnd xmi:id="_F" name="source" type="_C" isUnique="false"
> association="_E">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_H" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_I" value="1"/>
> </ownedEnd>
> <ownedEnd xmi:id="_G" name="target" type="_D"
> isUnique="false" association="_E">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_J" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_K" value="1"/>
> </ownedEnd>
> </packagedElement>
> </packagedElement>
> </uml:Model>
>
>
> (**) Here's the generated .ecore file.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage 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"
> name="Test02_model"
> nsURI="http:///Test02_model.ecore" nsPrefix="Test02_model">
> <eSubpackages name="Test02_pkg"
> nsURI="http:///Test02_model/Test02_pkg.ecore"
> nsPrefix="Test02_model.Test02_pkg">
> <eClassifiers xsi:type="ecore:EClass" name="Class1"/>
> <eClassifiers xsi:type="ecore:EClass" name="Class2"/>
> </eSubpackages>
> </ecore:EPackage>
Re: uml:Association disappears in ecore model generated from uml2 [message #474746 is a reply to message #474745] Mon, 30 July 2007 20:10 Go to previous messageGo to next message
Dave Carlson is currently offline Dave Carlson
Messages: 399
Registered: July 2009
Senior Member
Toshinao,
I took a quick look at TopCased a few months ago, and it appeared that they
alway model navigable associations by using the alternative UML
representation where navigable ends are owned by the Association, instead of
owned by the source class (as indicated by Kenn). Both are valid UML
representations, but for code generation from the model I think that tools
should use the Class owned navigable ends by default. This is a key reason
why I chose not to look at TopCased beyond my initial review...

Regards,
Dave Carlson

"Kenn Hussey" <khussey@ca.ibm.com> wrote in message
news:f8lemd$70k$1@build.eclipse.org...
> Toshinao,
>
> Both of the association ends are owned by the association, which means
> that when the model is mapped to EMOF (Ecore), the properties will be
> lost. In order to preserve an association end, the property representing
> it needs to be owned by the end type (i.e. the class).
>
> Kenn
>
> "Toshinao Ishii" <i_j_e_x_a@yahoo.co.jp> wrote in message
> news:f8lckb$lj6$1@build.eclipse.org...
>> Hi.
>>
>> I have just started writing a simple UML model
>> (by using TOPCASED TOOLS) and convert it to
>> ecore. A problem I met is that a UML element
>> of Association is not converted to an EMF element
>> but it just disappears.
Re: uml:Association disappears in ecore model generated from uml2 [message #474983 is a reply to message #474746] Mon, 06 August 2007 14:52 Go to previous message
Eclipse User
Originally posted by: i_j_e_x_a.yahoo.co.jp

Thank you for comments. I've got to understand the reason.

Do you know a UML class diagramming tool that generate
EMF importer recognizable uml:Association representation ?

Dave Carlson wrote:
> Toshinao,
> I took a quick look at TopCased a few months ago, and it appeared that they
> alway model navigable associations by using the alternative UML
> representation where navigable ends are owned by the Association, instead of
> owned by the source class (as indicated by Kenn). Both are valid UML
> representations, but for code generation from the model I think that tools
> should use the Class owned navigable ends by default. This is a key reason
> why I chose not to look at TopCased beyond my initial review...
>
> Regards,
> Dave Carlson
>
> "Kenn Hussey" <khussey@ca.ibm.com> wrote in message
> news:f8lemd$70k$1@build.eclipse.org...
>> Toshinao,
>>
>> Both of the association ends are owned by the association, which means
>> that when the model is mapped to EMOF (Ecore), the properties will be
>> lost. In order to preserve an association end, the property representing
>> it needs to be owned by the end type (i.e. the class).
>>
>> Kenn
>>
>> "Toshinao Ishii" <i_j_e_x_a@yahoo.co.jp> wrote in message
>> news:f8lckb$lj6$1@build.eclipse.org...
>>> Hi.
>>>
>>> I have just started writing a simple UML model
>>> (by using TOPCASED TOOLS) and convert it to
>>> ecore. A problem I met is that a UML element
>>> of Association is not converted to an EMF element
>>> but it just disappears.
Re: uml:Association disappears in ecore model generated from uml2 [message #624121 is a reply to message #474744] Mon, 30 July 2007 19:37 Go to previous message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
Toshinao,

Both of the association ends are owned by the association, which means that
when the model is mapped to EMOF (Ecore), the properties will be lost. In
order to preserve an association end, the property representing it needs to
be owned by the end type (i.e. the class).

Kenn

"Toshinao Ishii" <i_j_e_x_a@yahoo.co.jp> wrote in message
news:f8lckb$lj6$1@build.eclipse.org...
> Hi.
>
> I have just started writing a simple UML model
> (by using TOPCASED TOOLS) and convert it to
> ecore. A problem I met is that a UML element
> of Association is not converted to an EMF element
> but it just disappears.
>
>
> The model is really simple. There's two classes
> (say Class1 and Class2) and they have an association
> between them. (*)
>
> In order to convert it to ecore model, I used the
> eclipse (3.3) wizard to create a new EMF model from UML.
> In the generated .ecore file (**), there's no element
> (I expect EReference obviously) which is converted
> from the uml:Association.
>
> I guess uml:Association should be converted to
> ecore:EReference in the procedure and there was
> something wrong somewhere.
>
> Please let me know how to do correctly.
>
> Thanks in advance.
>
>
> (*) The association is serialized like the following.
> (The "xmi:id"s are converted by hand for this message.)
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Model xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xmi:id="_A" name="Test02_model">
> <packagedElement xmi:type="uml:Package" xmi:id="_B" name="Test02_pkg">
> <packagedElement xmi:type="uml:Class" xmi:id="_C" name="Class1"/>
> <packagedElement xmi:type="uml:Class" xmi:id="_D" name="Class2"/>
> <packagedElement xmi:type="uml:Association" xmi:id="_E"
> name="Class1-Class2" memberEnd="_F _G" navigableOwnedEnd="_F _G">
> <ownedEnd xmi:id="_F" name="source" type="_C" isUnique="false"
> association="_E">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_H" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_I" value="1"/>
> </ownedEnd>
> <ownedEnd xmi:id="_G" name="target" type="_D"
> isUnique="false" association="_E">
> <upperValue xmi:type="uml:LiteralUnlimitedNatural"
> xmi:id="_J" value="1"/>
> <lowerValue xmi:type="uml:LiteralInteger"
> xmi:id="_K" value="1"/>
> </ownedEnd>
> </packagedElement>
> </packagedElement>
> </uml:Model>
>
>
> (**) Here's the generated .ecore file.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage 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"
> name="Test02_model"
> nsURI="http:///Test02_model.ecore" nsPrefix="Test02_model">
> <eSubpackages name="Test02_pkg"
> nsURI="http:///Test02_model/Test02_pkg.ecore"
> nsPrefix="Test02_model.Test02_pkg">
> <eClassifiers xsi:type="ecore:EClass" name="Class1"/>
> <eClassifiers xsi:type="ecore:EClass" name="Class2"/>
> </eSubpackages>
> </ecore:EPackage>
Re: uml:Association disappears in ecore model generated from uml2 [message #624142 is a reply to message #474745] Mon, 30 July 2007 20:10 Go to previous message
Dave Carlson is currently offline Dave Carlson
Messages: 399
Registered: July 2009
Senior Member
Toshinao,
I took a quick look at TopCased a few months ago, and it appeared that they
alway model navigable associations by using the alternative UML
representation where navigable ends are owned by the Association, instead of
owned by the source class (as indicated by Kenn). Both are valid UML
representations, but for code generation from the model I think that tools
should use the Class owned navigable ends by default. This is a key reason
why I chose not to look at TopCased beyond my initial review...

Regards,
Dave Carlson

"Kenn Hussey" <khussey@ca.ibm.com> wrote in message
news:f8lemd$70k$1@build.eclipse.org...
> Toshinao,
>
> Both of the association ends are owned by the association, which means
> that when the model is mapped to EMOF (Ecore), the properties will be
> lost. In order to preserve an association end, the property representing
> it needs to be owned by the end type (i.e. the class).
>
> Kenn
>
> "Toshinao Ishii" <i_j_e_x_a@yahoo.co.jp> wrote in message
> news:f8lckb$lj6$1@build.eclipse.org...
>> Hi.
>>
>> I have just started writing a simple UML model
>> (by using TOPCASED TOOLS) and convert it to
>> ecore. A problem I met is that a UML element
>> of Association is not converted to an EMF element
>> but it just disappears.
Re: uml:Association disappears in ecore model generated from uml2 [message #624258 is a reply to message #474746] Mon, 06 August 2007 14:52 Go to previous message
Eclipse User
Originally posted by: i_j_e_x_a.yahoo.co.jp

Thank you for comments. I've got to understand the reason.

Do you know a UML class diagramming tool that generate
EMF importer recognizable uml:Association representation ?

Dave Carlson wrote:
> Toshinao,
> I took a quick look at TopCased a few months ago, and it appeared that they
> alway model navigable associations by using the alternative UML
> representation where navigable ends are owned by the Association, instead of
> owned by the source class (as indicated by Kenn). Both are valid UML
> representations, but for code generation from the model I think that tools
> should use the Class owned navigable ends by default. This is a key reason
> why I chose not to look at TopCased beyond my initial review...
>
> Regards,
> Dave Carlson
>
> "Kenn Hussey" <khussey@ca.ibm.com> wrote in message
> news:f8lemd$70k$1@build.eclipse.org...
>> Toshinao,
>>
>> Both of the association ends are owned by the association, which means
>> that when the model is mapped to EMOF (Ecore), the properties will be
>> lost. In order to preserve an association end, the property representing
>> it needs to be owned by the end type (i.e. the class).
>>
>> Kenn
>>
>> "Toshinao Ishii" <i_j_e_x_a@yahoo.co.jp> wrote in message
>> news:f8lckb$lj6$1@build.eclipse.org...
>>> Hi.
>>>
>>> I have just started writing a simple UML model
>>> (by using TOPCASED TOOLS) and convert it to
>>> ecore. A problem I met is that a UML element
>>> of Association is not converted to an EMF element
>>> but it just disappears.
Previous Topic:Migrating own Metamodel based on UML2.0.3
Next Topic:What the impact of changing applied UML profile
Goto Forum:
  


Current Time: Mon Oct 20 08:17:17 GMT 2014

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

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