Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Defining a new DataType for EMF/Ecore in UML
Defining a new DataType for EMF/Ecore in UML [message #825200] Tue, 20 March 2012 15:41 Go to next message
Christoph Reuteler is currently offline Christoph Reuteler
Messages: 7
Registered: March 2012
Junior Member
I am trying to define a new DataType in a class diagram (UML-Tool: Visual Paradigm)as explained in the book "EMF Eclipse Modeling Framework", page 131. For example:
<<datatype>Point <<javaclass>>org.eclipse....Point.

When i import the model i get a error message:
-The required feature 'eAttributeType' of 'platform:/resource/test/model.ecore#//test/Point/orgeclipsedraw2dgeometryPoint' must be set model.

Could anybody help me?

Thanks

  • Attachment: Test.xmi.uml
    (Size: 372.63KB, Downloaded 74 times)
Re: Defining a new DataType for EMF/Ecore in UML [message #825206 is a reply to message #825200] Tue, 20 March 2012 15:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26127
Registered: July 2009
Senior Member
Christoph,

It's better to ask about UML on the eclipse.modeling.mdt.uml2
newsgroup/forum.

One approach you might try is to define it in Ecore, and use the
*.genmodel's Export... from the context menu to export to UML and see
how it looks...


On 20/03/2012 4:41 PM, Christoph Reuteler wrote:
> I am trying to define a new DataType in a class diagram (UML-Tool: Visual Paradigm)as explained in the book "EMF Eclipse Modeling Framework", page 131. For example:
> <<datatype>Point<<javaclass>>org.eclipse....Point.
>
> When i import the model i get a error message:
> -The required feature 'eAttributeType' of 'platform:/resource/test/model.ecore#//test/Point/orgeclipsedraw2dgeometryPoint' must be set model.
>
> Could anybody help me?
>
> Thanks
>
>
Re: Defining a new DataType for EMF/Ecore in UML [message #825235 is a reply to message #825206] Tue, 20 March 2012 16:37 Go to previous messageGo to next message
Christoph Reuteler is currently offline Christoph Reuteler
Messages: 7
Registered: March 2012
Junior Member
Hello Ed

I have tried it out and defined the new data type like this:
<<primitive>> <<EDataType>> Point and the attribute as i had it.
Wen is start the genmodel i get now error message.
In the ecore file there is a new EData Type withe name Point but the Instance Type Name is also Point instead of org.eclipse....Point.

Have you any idea how to define the attribute properly?

Thanks a lot.

Christoph
Re: Defining a new DataType for EMF/Ecore in UML [message #825244 is a reply to message #825235] Tue, 20 March 2012 16:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26127
Registered: July 2009
Senior Member
Christoph,

Comments below.

On 20/03/2012 5:37 PM, Christoph Reuteler wrote:
> Hello Ed
>
> I have tried it out and defined the new data type like this:
> <<primitive>> <<EDataType>> Point and the attribute as i had it.
I'm not sure what primitive means. In Java they're types like int, but
in UML, I don't know. I'm sure you need to specify an instance type
name somehow because there's no other way for it to be figured out.
> Wen is start the genmodel i get now error message.
> In the ecore file there is a new EData Type withe name Point but the
> Instance Type Name is also Point instead of org.eclipse....Point.
>
> Have you any idea how to define the attribute properly?
It sounds like a problem with defining a data type not with defining an
attribute (though your previous post sounded like an attribute without a
type at all). All these are really UML2 questions. That project
contributes the importer and the exporter...
>
> Thanks a lot.
>
> Christoph
>
Re: Defining a new DataType for EMF/Ecore in UML [message #825259 is a reply to message #825244] Tue, 20 March 2012 17:07 Go to previous messageGo to next message
Christoph Reuteler is currently offline Christoph Reuteler
Messages: 7
Registered: March 2012
Junior Member
I'm not really UML expert. According to the UML book it seamed very easy to create a new DataType in UML. In the ecore file the new type is recognized as EDataType and in the class test the attribute point is also recognized as EDataType. As you mentioned there must be a keyword in UML to tell EMF that it is a InstanceType.

Thanks
Re: Defining a new DataType for EMF/Ecore in UML [message #825273 is a reply to message #825259] Tue, 20 March 2012 17:14 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26127
Registered: July 2009
Senior Member
Christoph,

It's not a case of it being an instance type, it's a case of it having
and instance type. I assume you're specifying the Ecore profile; there
must be a property you can set for this...


On 20/03/2012 6:07 PM, Christoph Reuteler wrote:
> I'm not really UML expert. According to the UML book it seamed very
> easy to create a new DataType in UML. In the ecore file the new type
> is recognized as EDataType and in the class test the attribute point
> is also recognized as EDataType. As you mentioned there must be a
> keyword in UML to tell EMF that it is a InstanceType.
>
> Thanks
Re: Defining a new DataType for EMF/Ecore in UML [message #825281 is a reply to message #825273] Tue, 20 March 2012 17:25 Go to previous messageGo to next message
Christoph Reuteler is currently offline Christoph Reuteler
Messages: 7
Registered: March 2012
Junior Member
No Message Body
Re: Defining a new DataType for EMF/Ecore in UML [message #825283 is a reply to message #825273] Tue, 20 March 2012 17:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4086
Registered: July 2009
Senior Member
Hi

You can look at /org.eclipse.uml2.uml/model/Ecore.uml for many examples
of ok EDataType declarations.

Regards

Ed Willink

On 20/03/2012 13:14, Ed Merks wrote:
> Christoph,
>
> It's not a case of it being an instance type, it's a case of it having
> and instance type. I assume you're specifying the Ecore profile;
> there must be a property you can set for this...
>
>
> On 20/03/2012 6:07 PM, Christoph Reuteler wrote:
>> I'm not really UML expert. According to the UML book it seamed very
>> easy to create a new DataType in UML. In the ecore file the new type
>> is recognized as EDataType and in the class test the attribute point
>> is also recognized as EDataType. As you mentioned there must be a
>> keyword in UML to tell EMF that it is a InstanceType.
>>
>> Thanks
Re: Defining a new DataType for EMF/Ecore in UML [message #825284 is a reply to message #825281] Tue, 20 March 2012 17:28 Go to previous messageGo to next message
Christoph Reuteler is currently offline Christoph Reuteler
Messages: 7
Registered: March 2012
Junior Member
I have not defined a profile in UML. I just used stereotypes. I don't know whether there is a stereotype like <<instancetype>> in UML.
Re: Defining a new DataType for EMF/Ecore in UML [message #825288 is a reply to message #825284] Tue, 20 March 2012 17:31 Go to previous message
Christoph Reuteler is currently offline Christoph Reuteler
Messages: 7
Registered: March 2012
Junior Member
Than you for this link. I will have a look there.
Previous Topic:How to persist (serialize) the CommandStack (undo-stack)
Next Topic:[xcore] find references for juno?
Goto Forum:
  


Current Time: Tue Oct 21 05:35:51 GMT 2014

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

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