Author Topic: How to use the Subtype Property?  (Read 4922 times)

Modesto Vega

  • EA User
  • **
  • Posts: 624
  • Karma: +18/-8
    • View Profile
How to use the Subtype Property?
« on: May 04, 2021, 08:11:57 pm »
I cannot find any documentation on how to use the Subtype property, perhaps I have not looked hard enough.

The caption reads
Quote
"Name of an enumeration tagged value, in the form of "Profile::Stereotype::Tag". When the element is created, a sub-menu will list all the enumeration literals."

I understand this as meaning that I can create an enumeration with the subtype values and link it to the Subtype Property. However, since there is no way to select an existing enumeration, I am not sure how to link them.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7568
  • Karma: +94/-17
    • View Profile
Re: How to use the Subtype Property?
« Reply #1 on: May 05, 2021, 08:17:49 am »
Fill in the names of your profile, the stereotype defining the tag and the tag itself.
Eve

support@sparxsystems.com

Modesto Vega

  • EA User
  • **
  • Posts: 624
  • Karma: +18/-8
    • View Profile
Re: How to use the Subtype Property?
« Reply #2 on: May 06, 2021, 12:56:29 am »
Fill in the names of your profile, the stereotype defining the tag and the tag itself.
Thanks for the telegraphic answer.

Just for the record, this is what I had to do to get this working:
  • Create an enumeration with the desired subtype values
  • In Stereotype Properties/Tagged Values, add to the stereotype an enumeration specialised tagged value and point it to the enumeration created in the previous step
  • In Stereotype Properties/General, select metaclass being extended and in the subtype property enter the fully qualified name of the tag holding the subtype - e.g., MyProfile::Class:Type[/i]

    This should do the trick. Unfortunately, I cannot find anywhere in the documentation but perhaps I was too inpatient and did not look hard enough.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7948
  • Karma: +207/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to use the _subtypeProperty?
« Reply #3 on: May 06, 2021, 09:48:13 am »
Hi Modesto,
A quick question.  You are trying to use this (_subtypeProperty) for elements other than Activity?  The implication of the Help is that it is for Activity only - since that is the only Element Type listed in the See also.  From your post, it seems to work for Class, yes?  Did you try anything else?

TIA,
Paolo
« Last Edit: May 06, 2021, 09:50:14 am by Paolo F Cantoni »
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: 2851
  • Karma: +48/-3
    • View Profile
Re: How to use the _subtypeProperty?
« Reply #4 on: May 06, 2021, 10:00:32 am »
Hi Modesto,
A quick question.  You are trying to use this (_subtypeProperty) for elements other than Activity?  The implication of the Help is that it is for Activity only - since that is the only Element Type listed in the See also.  From your post, it seems to work for Class, yes?  Did you try anything else?

TIA,
Paolo


I think you're reading too much into that 'See Also'. _subtypeProperty can be used with any metaclass, even connector metaclasses. All it does is set a tagged value on creation.
The Sparx Team
support@sparxsystems.com

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 7568
  • Karma: +94/-17
    • View Profile
Re: How to use the Subtype Property?
« Reply #5 on: May 06, 2021, 10:53:47 am »
Make sure the _subtypeProperty is specified on the metaclass.

Other than that, here's a working example.

Code: [Select]
<?xml version="1.0" encoding="windows-1252"?>
<UMLProfile profiletype="uml2">
<Documentation id="2D919350-9" name="Subtype" version="1.0" notes="Subtype"/>
<Content>
<Stereotypes>
<Stereotype name="Toast" notes="">
<AppliesTo>
<Apply type="Class">
<Property name="_subtypeProperty" value="Subtype::Toast::spread"/>
<Property name="isActive" value=""/>
</Apply>
</AppliesTo>
<TaggedValues>
<Tag name="spread" type="enumeration" description="" unit="" values="peanutButter,jam,vegemite,honey" default=""/>
</TaggedValues>
</Stereotype>
</Stereotypes>
<TaggedValueTypes/>
<ViewDefinitions/>
<Metamodel/>
</Content>
</UMLProfile>
Eve

support@sparxsystems.com

qwerty

  • EA Guru
  • *****
  • Posts: 12333
  • Karma: +347/-287
  • I'm no guru at all
    • View Profile
Re: How to use the Subtype Property?
« Reply #6 on: May 06, 2021, 05:31:36 pm »
Make sure the _subtypeProperty is specified on the metaclass.

Other than that, here's a working example.

Interesting! I right away tried that and, whoa!, there popped up a menu with the spread. Great! But wait, this is EA. Despite selecting one of the entries the property was empty then. I had to manually re-select it. This is a feature, I guess?

Let's see. Ah well, it's EAUI. You have to deselect the element and select it again. Then you see the property.

Wouldn't it be nice to have something developed that a customer could not start mocking about immediately?

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7948
  • Karma: +207/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to use the Subtype Property?
« Reply #7 on: May 06, 2021, 06:11:22 pm »
[SNIP]
Wouldn't it be nice to have something developed that a customer could not start mocking about immediately?
q.
(my emphasis)
Maybe their testing mocks aren't "up to scratch"?  (couldn't resist)

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

qwerty

  • EA Guru
  • *****
  • Posts: 12333
  • Karma: +347/-287
  • I'm no guru at all
    • View Profile
Re: How to use the Subtype Property?
« Reply #8 on: May 06, 2021, 07:32:38 pm »
Didn't we alread agree that Sparx' QA are their users?

q.

Modesto Vega

  • EA User
  • **
  • Posts: 624
  • Karma: +18/-8
    • View Profile
Re: How to use the _subtypeProperty?
« Reply #9 on: May 06, 2021, 08:01:47 pm »
Hi Modesto,
A quick question.  You are trying to use this (_subtypeProperty) for elements other than Activity?  The implication of the Help is that it is for Activity only - since that is the only Element Type listed in the See also.  From your post, it seems to work for Class, yes?  Did you try anything else?

TIA,
Paolo
Hi Paolo,

I am currently using it for classes and will soon used it for components. It works fine for classes and I expect the same for components. This allows me to flatten the meta-model.

The XML generated is a per Eve's last reply.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7948
  • Karma: +207/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to use the Subtype Property?
« Reply #10 on: August 02, 2021, 01:05:48 pm »
Fill in the names of your profile, the stereotype defining the tag and the tag itself.
Thanks for the telegraphic answer.

Just for the record, this is what I had to do to get this working:
  • Create an enumeration with the desired subtype values
  • In Stereotype Properties/Tagged Values, add to the stereotype an enumeration specialised tagged value and point it to the enumeration created in the previous step
  • In Stereotype Properties/General, select metaclass being extended and in the subtype, property enter the fully qualified name of the tag holding the subtype - e.g., MyProfile::Class:Type[/i]

    This should do the trick. Unfortunately, I cannot find it anywhere in the documentation but perhaps I was too inpatient and did not look hard enough.
(my emphasis)
Hi Modesto,  finally getting around to having a look at this...
Firstly, I think the word you were after was impatient.  An in-patient is in a hospital (so maybe you were being accurate!)  ;)

I just want to clarify that the _subtypeProperty has to be in the (in our view incorrectly) Metaclass.  This, surely, is a property of the stereotype?

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

qwerty

  • EA Guru
  • *****
  • Posts: 12333
  • Karma: +347/-287
  • I'm no guru at all
    • View Profile
Re: How to use the Subtype Property?
« Reply #11 on: August 02, 2021, 08:13:08 pm »
m an n are quite next to each other on the keyboard. Might simply be a typo. Comes ages, comes typo - my fingers do not seem to obey my brain they used to do.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 7948
  • Karma: +207/-127
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to use the Subtype Property?
« Reply #12 on: August 02, 2021, 10:14:00 pm »
m an n are quite next to each other on the keyboard. Might simply be a typo. Comes ages comes typos - my fingers do not seem to obey my brain they used to do.

q.
I use a grammar checker that automatically indicates errors.  (it fixed up some of your above... ;))

Anyway, it "tickled my fancy"...

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

qwerty

  • EA Guru
  • *****
  • Posts: 12333
  • Karma: +347/-287
  • I'm no guru at all
    • View Profile
Re: How to use the Subtype Property?
« Reply #13 on: August 03, 2021, 12:01:27 am »
Well, I wrote truely. With quite some (unwanted) typos. I like that proverb: if you find any spelling errors you may keep them.

q.