Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Attributes of Custom Datatype is not seen in papyrus(Attributes of Custom Datatype is not seen in papyrus)
Attributes of Custom Datatype is not seen in papyrus [message #1808383] Sun, 23 June 2019 11:07 Go to next message
Mohammad Inayatullah is currently offline Mohammad InayatullahFriend
Messages: 21
Registered: May 2019
Junior Member
i want to generate C# code from papyrus model, for which i have to place the attribute on C# properties like [Column(TypeName = "nvarchar(5)")],
My assumption is that i will create custom data types and will add Length attribute to that datatype and then i will read that attribute in acceleo code generator. I tried this but could not accomplish.

Can any one please guide me that how will i do this.

Thanks
Mohammad Inayatullah
Re: Attributes of Custom Datatype is not seen in papyrus [message #1808384 is a reply to message #1808383] Sun, 23 June 2019 11:16 Go to previous messageGo to next message
Vittorio Niespolo is currently offline Vittorio NiespoloFriend
Messages: 11
Registered: May 2019
Junior Member
I think you should use an annotation getter for your property and add it to your template. Something like:

[getAnnotation(property)/]
private [p.type.name/] [p.name/];

[public template getAnnotation(p : Property)]
//HERE add conditions for that annotation. 
For example you can extend property metaclass with a stereotype that store the typeName and typeLenght
[/template]

[Updated on: Sun, 23 June 2019 11:17]

Report message to a moderator

Re: Attributes of Custom Datatype is not seen in papyrus [message #1808388 is a reply to message #1808384] Sun, 23 June 2019 13:18 Go to previous messageGo to next message
Mohammad Inayatullah is currently offline Mohammad InayatullahFriend
Messages: 21
Registered: May 2019
Junior Member
Thanks so much for your help. I appreciate your help.
But can you please guide me that how will i add Annotation in papyrus model.

Thanks
Mohammad Inayatullah
Re: Attributes of Custom Datatype is not seen in papyrus [message #1808443 is a reply to message #1808388] Mon, 24 June 2019 17:19 Go to previous messageGo to next message
Vittorio Niespolo is currently offline Vittorio NiespoloFriend
Messages: 11
Registered: May 2019
Junior Member
You have to learn about UML Stereotype and Profiles.
It's a must have for this requirements
Re: Attributes of Custom Datatype is not seen in papyrus [message #1808549 is a reply to message #1808443] Wed, 26 June 2019 17:07 Go to previous messageGo to next message
Mohammad Inayatullah is currently offline Mohammad InayatullahFriend
Messages: 21
Registered: May 2019
Junior Member
Can you please guide me in this

https://www.eclipse.org/forums/index.php/m/1808548/#msg_1808548
Re: Attributes of Custom Datatype is not seen in papyrus [message #1808554 is a reply to message #1808549] Wed, 26 June 2019 17:39 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7676
Registered: July 2009
Senior Member
Hi

No. Since there is no relevant question here and the answer there makes clear that you really should read the Getting Started tutorial for Acceleo (and Eclipse UML2).

Regards

Ed Willink
Previous Topic:[Acceleo] Assigning a Template Result to a Variable
Next Topic:Best way to use "separator" in an if chain
Goto Forum:
  


Current Time: Thu Oct 10 20:32:14 GMT 2024

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

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

Back to the top