Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Papyrus and attributes' types
Papyrus and attributes' types [message #936220] Sun, 07 October 2012 20:35 Go to next message
Crush Mach is currently offline Crush Mach
Messages: 6
Registered: September 2012
Junior Member
Hi,

I am trying to use Papyrus and Acceleo to generate code. But I am facing a problem with attributes' types. I want to generate a java.util.Date attribute but all I can find is an EDate. Same thing with any other type which is not a primitive type.

Any idea how I can resolve this?
Re: Papyrus and attributes' types [message #936243 is a reply to message #936220] Sun, 07 October 2012 21:09 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

The instanceTypeName of EDate is java.util.Date so you may be creating a
problem where none exists.

But since you don't give any details, only you can know.

Regards

Ed Willink


On 07/10/2012 21:35, Crush Mach wrote:
> Hi,
> I am trying to use Papyrus and Acceleo to generate code. But I am
> facing a problem with attributes' types. I want to generate a
> java.util.Date attribute but all I can find is an EDate. Same thing
> with any other type which is not a primitive type.
>
> Any idea how I can resolve this?
Re: Papyrus and attributes' types [message #936279 is a reply to message #936243] Sun, 07 October 2012 22:07 Go to previous messageGo to next message
Crush Mach is currently offline Crush Mach
Messages: 6
Registered: September 2012
Junior Member
Thx Ed for your reply,
I understand that. My problem is that I have to generate a specific java code from my class diagram and it has to have Date, Long ...as types, and not EDate
Re: Papyrus and attributes' types [message #936743 is a reply to message #936279] Mon, 08 October 2012 09:35 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
Hi

So what's the problem? An Acceleo template is very capable of using the
instanceTypeName of an EDataType.

Regards

Ed Willink

On 07/10/2012 23:07, Crush Mach wrote:
> Thx Ed for your reply, I understand that. My problem is that I have to
> generate a specific java code from my class diagram and it has to have
> Date, Long ...as types, and not EDate
Re: Papyrus and attributes' types [message #938128 is a reply to message #936743] Tue, 09 October 2012 15:15 Go to previous message
Camille Letavernier is currently offline Camille Letavernier
Messages: 456
Registered: February 2011
Senior Member
Hello,


You probably need to define a UML DataType in your model (e.g. create a new DataType named "Date"). Then you use this datatype to type your UML properties.

In your acceleo template, simply generate a java.util.Date object each time you have a property typed with your UML DataType named "Date". Thus, you won't need to use the Ecore EDataType/EDate elements.


Regards,
Camille


Camille Letavernier
Papyrus developer
Previous Topic:Relationship of Editors to Resource Sets
Next Topic:Why I cannot create a papyrus project
Goto Forum:
  


Current Time: Thu Sep 18 13:57:55 GMT 2014

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

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