Book a Demo

Author Topic: Proper declaration enum with items in MDG  (Read 2891 times)

PiotrS24

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Proper declaration enum with items in MDG
« on: February 24, 2020, 12:22:42 am »
Hi

I want to create my own Enum with items. I do this, it works, but with one disadvenatege
Meta model looks like:
https://drive.google.com/open?id=1v3k60ssf3Qk8L7Uilq6l9WxYv75veWZa

I can use this model when I do this steps
1) add item to enum using Featuers/Attribute
2) change on properties page
3) set manually stereoptype "Enum Item"
4) update tags values in "properties" tab

I wanto do drag enum item from toolbar like on this example
https://drive.google.com/open?id=1EZDwByzqZRsxG8tXqYGFGRvas-GdofFg

In same meta model, I have example with class and attribute all works fine when I drag field to class
What I do wrong ?

Best regards, Peter




philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Proper declaration enum with items in MDG
« Reply #1 on: February 24, 2020, 11:23:57 pm »
What I would do is let you enum stereotype extend the Metaclass Attribute rather than Enumeration

Then you should inherit the "drag and drop" behaviour you desire.

All the best
Phil
Models are great!
Correct models are even greater!

PiotrS24

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Proper declaration enum with items in MDG
« Reply #2 on: February 27, 2020, 06:42:07 am »
When I saw that I have a problem with the definition based on enum, I did it in class
And it worked. And it could practically stay that way.
However, because it is an enum, I wanted to do it according to art. Hence my question.
So if you can model an enum then you should also model the item to enum. And you can do it but the method I found is a bit around. It is possible that there is something better on enums so I could use them.

In summary, I know that I could work around the problem using classes, but maybe you can do it without this.

greetings Piotr