Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Referencing a uml model element from a ecore model
Referencing a uml model element from a ecore model [message #473638] Fri, 29 June 2007 16:34 Go to next message
Andrew Jackson is currently offline Andrew JacksonFriend
Messages: 24
Registered: July 2009
Junior Member
Hey,

I am trying to define a traceability meta-model that links model elements
in instances of a requirements meta-model and UML model elements.

So far i have defined a traceability meta-model that has a trace class,
which contains references to NamedElements.

<?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="myTrace"
nsURI="myTrace" nsPrefix="myTrace">
<eClassifiers xsi:type="ecore:EClass" name="Trace">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id"
eType="ecore:EDataType
platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//E String "/>
<eStructuralFeatures xsi:type="ecore:EReference" name="uml"
eType="ecore:EClass
platform:/plugin/org.eclipse.uml2.uml/model/UML.ecore#//Name dElement "
containment="true"/>
</eClassifiers>
</ecore:EPackage>

After that i create a .genmodel for this and generate all. When i run the
editor to create a .trace model instance i can add a new named element.
This is not what i want to do tho. I want to be able to create a reference
to an existing named element in a separate .uml file.

How do i do this?

Thanks in advance,
Andrew
Re: Referencing a uml model element from a ecore model [message #473644 is a reply to message #473638] Wed, 04 July 2007 11:34 Go to previous messageGo to next message
Andrew Jackson is currently offline Andrew JacksonFriend
Messages: 24
Registered: July 2009
Junior Member
Hey,

For anyone who comes up against this again. The answer i have found to
cope with that is to get the ids of uml elements. And save those as
references to the elements from external models.

If anyone has a cleaner way to do this please let me know.
Andrew
Re: Referencing a uml model element from a ecore model [message #473759 is a reply to message #473644] Thu, 05 July 2007 12:32 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andrew,

I noticed that your 'uml' feature is a containment feature... if your intent
is only to reference elements from an existing UML model and not to contain
them in your traceability model, then this feature should not be a
containment feature.

Kenn

"Andrew Jackson" <Andrew.Jackson@cs.tcd.ie> wrote in message
news:72c61b020f965bc19530b5da279e063c$1@www.eclipse.org...
> Hey,
> For anyone who comes up against this again. The answer i have found to
> cope with that is to get the ids of uml elements. And save those as
> references to the elements from external models.
>
> If anyone has a cleaner way to do this please let me know.
> Andrew
>
Re: Referencing a uml model element from a ecore model [message #622716 is a reply to message #473638] Wed, 04 July 2007 11:34 Go to previous message
Andrew Jackson is currently offline Andrew JacksonFriend
Messages: 24
Registered: July 2009
Junior Member
Hey,

For anyone who comes up against this again. The answer i have found to
cope with that is to get the ids of uml elements. And save those as
references to the elements from external models.

If anyone has a cleaner way to do this please let me know.
Andrew
Re: Referencing a uml model element from a ecore model [message #622731 is a reply to message #473644] Thu, 05 July 2007 12:32 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Andrew,

I noticed that your 'uml' feature is a containment feature... if your intent
is only to reference elements from an existing UML model and not to contain
them in your traceability model, then this feature should not be a
containment feature.

Kenn

"Andrew Jackson" <Andrew.Jackson@cs.tcd.ie> wrote in message
news:72c61b020f965bc19530b5da279e063c$1@www.eclipse.org...
> Hey,
> For anyone who comes up against this again. The answer i have found to
> cope with that is to get the ids of uml elements. And save those as
> references to the elements from external models.
>
> If anyone has a cleaner way to do this please let me know.
> Andrew
>
Previous Topic:How to get Project of Element or Model
Next Topic:Customize standard UML Editor to hide selected elements?
Goto Forum:
  


Current Time: Sat Sep 23 23:52:27 GMT 2017

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

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