Export enum default values as Ecore.defaultValueLiteral

UML related questions and discussions

Moderator: Moderators

Export enum default values as Ecore.defaultValueLiteral

Postby Sebastian.Zitzelsberger@maibornwolff.de » Wed Dec 21, 2016 4:28 am

Hi there,
i am designing an Ecore-Model with MagicDraw (currently using 18.5 beta) and i need to define a default value for some Enumeration-Attributes.
When i model a default value for basic type Attributes (Estring etc) the defaultValue i define in magic draw gets exported as the defaultValueLiteral - Ecore-attribute.
But for enumerations that is not the case.


Am i doing something wrong or is this not supported yet?
Sebastian.Zitzelsberger@maibornwolff.de
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Wed Dec 21, 2016 4:23 am

Re: Export enum default values as Ecore.defaultValueLiteral

Postby marlel » Fri Dec 23, 2016 1:04 am

Hello,

Can you please attach the sample.
Best regards,
Martynas
marlel
No Magic
No Magic
 
Posts: 218
Posts Rating:16
Joined: Wed Jul 11, 2012 2:31 am

Re: Export enum default values as Ecore.defaultValueLiteral

Postby Sebastian.Zitzelsberger@maibornwolff.de » Thu Jan 26, 2017 4:47 am

Sorry for the long delay.
I created a sample project with the 18.0 LTR Version (Sp6).

It contains a Class with 2 Attributes and an Enum.
One attribute has a PrimtitiveType with a default value (which gets exported to ecore)
The other attribute is a reference to the Enum with a default value (which does not get exported: Validation CMOF 2.0 Validation::CommonWithEcore::NonExportableElementsInstVal fails).

Thanks
You do not have the required permissions to view the files attached to this post.
Sebastian.Zitzelsberger@maibornwolff.de
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Wed Dec 21, 2016 4:23 am

Re: Export enum default values as Ecore.defaultValueLiteral

Postby marlel » Fri Jan 27, 2017 9:31 am

So what are you exporting to? Ecore or C/EMOF?
Best regards,
Martynas
marlel
No Magic
No Magic
 
Posts: 218
Posts Rating:16
Joined: Wed Jul 11, 2012 2:31 am

Re: Export enum default values as Ecore.defaultValueLiteral

Postby Sebastian.Zitzelsberger@maibornwolff.de » Tue Jan 31, 2017 3:04 am

I am exporting to ecore, but the validation seem sto be applied automatically if i use the ecore profile.
I found a way though.
To get the default value exported to ecore as the default value literal you need to rightclick on the defaultvalue Label -> create value specification -> string value.


However i need assistance with another ecore attribute.
Ii need to define some values for the eKeys-Attribute of an EReference and i have not found a way to do so.
Any suggesstions?
Sebastian.Zitzelsberger@maibornwolff.de
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Wed Dec 21, 2016 4:23 am

Re: Export enum default values as Ecore.defaultValueLiteral

Postby marlel » Tue Jan 31, 2017 3:34 am

I think it is a bug the default value enumeration literal is not exported.

However i need assistance with another ecore attribute.
Ii need to define some values for the eKeys-Attribute of an EReference and i have not found a way to do so.
Any suggesstions?

There is no way to model and export this in MagicDraw.
Best regards,
Martynas
marlel
No Magic
No Magic
 
Posts: 218
Posts Rating:16
Joined: Wed Jul 11, 2012 2:31 am

Re: Export enum default values as Ecore.defaultValueLiteral

Postby Sebastian.Zitzelsberger@maibornwolff.de » Tue Jan 31, 2017 6:01 am

Well, obviously there are ways to model it.
However the current Ecore-Profile provided by MagicDraw does not include the ekeys Property in its EcoreReference Stereotype. T
he other Properties of EReference (eOpposite, resolve proxies, etc) are modelled though.
I tried modifying the ecore-Profile, but the export seems to ignore my added ekeys attributes.

How can i submit a feature request for this?
Sebastian.Zitzelsberger@maibornwolff.de
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Wed Dec 21, 2016 4:23 am

Re: Export enum default values as Ecore.defaultValueLiteral

Postby marlel » Wed Feb 01, 2017 1:58 am

Hello,

You can register your suggestion in our knowledge base https://www.nomagic.com/support/general ... wlegdebase.
Best regards,
Martynas
marlel
No Magic
No Magic
 
Posts: 218
Posts Rating:16
Joined: Wed Jul 11, 2012 2:31 am


Return to Software Modeling (UML)

Who is online

Users browsing this forum: No registered users and 0 guests

cron