Book a Demo

Author Topic: v15.2 - Specifying "generic" tags in profile  (Read 3007 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
v15.2 - Specifying "generic" tags in profile
« on: November 27, 2020, 03:38:25 pm »
We have been able to successfully include profile-based tags into our profile via the new Modelling mechanism (as opposed to our previous hand-crafted approach).  That is, we define our Tags (that end up in the <TaggedValueTypes> section), and then use them in our stereotypes.

These tags are defined as attributes of the stereotype and we can set a different default value from the main definition is required.  The values (especially for enumerations) are defined by the main definition in the <TaggedValueTypes> section.

We now also need to associate some "generic" as opposed to profile-based tags to some of our stereotypes.  What we want to end up with is:
Code: [Select]
<TaggedValues>
<Tag name="atomic" type="boolean" description="" unit="" values="true,false" default="false"/>
<Tag name="rotation" type="enumeration" description="" unit="" values="up,down,left,right" default="up"/>
</TaggedValues>

However, we can't see how to set the values attribute of the Tag definition in the stereotype atttribute.  We end up with:
Code: [Select]
<TaggedValues>
<Tag name="atomic" type="boolean" description="" unit="" values="true,false" default="false"/>
<Tag name="rotation" type="enumeration" description="" unit="" values="" default="up"/>
</TaggedValues>
See how the Values attribute is empty for "rotation"?  How do we fix this?  It would appear that EA will set the values attribute for the boolean type automatically.

TIA,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: v15.2 - Specifying "generic" tags in profile
« Reply #1 on: November 30, 2020, 07:34:37 am »
Create an enumeration element in your profile with literals (attributes) up, down, left and right. Then in the stereotype class, set the attribute's type to the enumeration.
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: v15.2 - Specifying "generic" tags in profile
« Reply #2 on: November 30, 2020, 11:38:21 am »
Create an enumeration element in your profile with literals (attributes) up, down, left and right. Then in the stereotype class, set the attribute's type to the enumeration.
Thanks, Neil!

"Easy when you know how..."

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!