Author Topic: Profile Tag Definition versus General Tag definition  (Read 6812 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8599
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Profile Tag Definition versus General Tag definition
« on: March 26, 2020, 08:09:23 pm »
I have a tagged value type defined in the general UML area IsLegalEntity
Code: [Select]
;v1.1 29-Jan-2020
Type=Boolean;
Default=«Uninitialized»;
NOTE: the first line is a versioning entry - EA doesn't seem to mind.
This works fine on a non-MDG-based item.  I get the drop-down to allow me to set True/False.
It even works if referenced in an MDG-based item.
Code: [Select]
<TaggedValues>
<Tag name="IsLegalEntity" default="«Uninitialized»"/>
</TaggedValues>
I get the expected behaviour.
However, if I attempt to create the same TaggedValueType directly in the MDG
Code: [Select]
<TaggedValueTypes>
<TaggedValueType property="IzLegalEntity" description="" notes="Type=Boolean;Default=«Uninitialized»;"/>
</TaggedValueTypes>
and reference it in my metatype
Code: [Select]
<TaggedValues>
<Tag name="IsLegalEntity" default="«Uninitialized»"/>
<Tag name="IzLegalEntity" default="«Uninitialized»"/>
</TaggedValues>
The profile one is created, but just appears to be a string and there's no dropdown.

IsLegalEntity works "just like a bought one"
IzLegalEntity doesn't...  :'(

What am I doing wrong?

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13303
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Profile Tag Definition versus General Tag definition
« Reply #1 on: March 26, 2020, 08:47:49 pm »
Paolo,

If you use the profile helper to select your existing tagged value type as the type of  tagged value, you can see how it exports into an MDG.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8599
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #2 on: March 26, 2020, 10:24:12 pm »
Paolo,

If you use the profile helper to select your existing tagged value type as the type of tagged value, you can see how it exports into an MDG.

Geert
Sorry, Geert, which one?  I've never used them and I can't see any of the 5 listed in the toolbox "fitting the bill".

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13303
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Profile Tag Definition versus General Tag definition
« Reply #3 on: March 26, 2020, 11:53:22 pm »
If you right click on a stereotype definition in a UML profile you can choose "Edit with profile helper"
In that dialog you can edit tagged values for your stereotype, and you can choose an existing tagged value type as the type.

If you then generate the UML profile, and generate the MDG you should have an example of how EA does this.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8599
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #4 on: March 27, 2020, 12:21:51 am »
If you right click on a stereotype definition in a UML profile you can choose "Edit with profile helper"
In that dialog you can edit tagged values for your stereotype, and you can choose an existing tagged value type as the type.

If you then generate the UML profile, and generate the MDG you should have an example of how EA does this.

Geert
Thanks, but that's not my use case.  It creates a tag specific to that metatype.  There doesn't seem to be any option that I can see to generate a profile tag.  I may be able to use what it did provide to cobble one up, but it's late here and I'll try in the morning.
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13303
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Profile Tag Definition versus General Tag definition
« Reply #5 on: March 27, 2020, 12:29:28 am »
If you just want to include a tagged value definition in an MDG that is possible as well.
In the generate MDG wizard there is a checkbox to include tagged value definitions.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8599
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #6 on: March 27, 2020, 09:22:48 am »
If you just want to include a tagged value definition in an MDG that is possible as well.
In the generate MDG wizard there is a checkbox to include tagged value definitions.

Geert
Thanks Geert!

It's literally many years since I used the MDG Generator, I've become so adept at "hand-rolling" the MDG, that for me,  it's faster!  So easy to forget when you don't use it frequently enough!

Unfortunately...  "I can't seem to take a trick".  I marked the TaggedValueTypes checkbox, added the TaggedValueTypes I wanted to check in the ensuing dialog, generated the MDG file and got...
Code: [Select]
</Stereotypes>
<TaggedValueTypes/>
<ViewDefinitions/>

NADA!

Can anyone confirm the functionality still works?  I'm running 15.1 (1528)

Paolo
« Last Edit: March 27, 2020, 09:24:29 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!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8066
  • Karma: +118/-20
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #7 on: March 27, 2020, 02:39:00 pm »
You're not going to like my answer. I know that because I don't like it.

Profile tagged values will only link to the technology tagged values when the technology id matches the profile name.

I don't actually know that's your problem, but I'd wager a pack of toilet paper on it.  ;)

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #8 on: March 27, 2020, 03:21:44 pm »
That's rich gambling. The last of the high rollers? (OUCH!)
Best Regards, Roy

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8599
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #9 on: March 27, 2020, 05:10:28 pm »
You're not going to like my answer. I know that because I don't like it.

Profile tagged values will only link to the technology tagged values when the technology id matches the profile name.

I don't actually know that's your problem, but I'd wager a pack of toilet paper on it.  ;)
(my emphasis) You're right, I don't like it...    :o :-X

By link, you do mean "be emitted by the generator", yes?

I've noticed that sometimes the Profile name and the ID are the same, and other times not.

Notwithstanding I've seen Sparxians and others refer to profile name when they meant profile id and vice versa, what is wrong with this generated MDG file?
If it IS wrong, how do I fix it so the Tagged Values Types link?  If it's correct, any other ideas why they weren't emitted?

Code: [Select]
<MDG.Technology version="1.0">
<Documentation id="Test" name="Test" version="0.1d" notes="Test MDG for Tagged Value Types"/>
<UMLProfiles>
<UMLProfile profiletype="uml2">
<Documentation id="78CD5448-1" name="Test" version="0.1a" notes="Test"/>
<Content>

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

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13303
  • Karma: +557/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Profile Tag Definition versus General Tag definition
« Reply #10 on: March 27, 2020, 05:32:55 pm »
Paolo,

I found an example that might help you

This is the relevant part of my (generated) MDG published here: https://github.com/GeertBellekens/Enterprise-Architect-Toolpack/blob/master/GlossaryManager/Files/EDD%20MDG.xml

Code: [Select]
<Stereotype name="EDD_DataItem" metatype="EDD_DataItem" notes="" cx="0" cy="0" generalizes="EDD_GlossaryItem" baseStereotypes="EDD_GlossaryItem">
<Icon type="bitmap" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">removed</Icon>
<Image type="EAShapeScript 1.0" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">removed</Image>
<TaggedValues>
<Tag name="format" type="" description="" unit="" values="" default=""/>
<Tag name="initial value" type="" description="" unit="" values="" default=""/>
<Tag name="label" type="" description="" unit="" values="" default=""/>
<Tag name="precision" type="" description="" unit="" values="" default=""/>
<Tag name="size" type="" description="" unit="" values="" default=""/>
<Tag name="business item"/>
<Tag name="logical datatype"/>
</TaggedValues>
</Stereotype>
<Stereotype name="EDD_GlossaryItem" notes="" cx="0" cy="0">
<AppliesTo>
<Apply type="Class">
<Property name="isActive" value=""/>
</Apply>
</AppliesTo>
<TaggedValues>
<Tag name="modifier" type="" description="" unit="" values="" default=""/>
</TaggedValues>
</Stereotype>
<Stereotype name="EDD_LogicalDatatype" metatype="EDD_LogicalDatatype" notes="" cx="0" cy="0">
<Icon type="bitmap" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">removed</Icon>
<Image type="EAShapeScript 1.0" xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.base64">removed</Image>
<AppliesTo>
<Apply type="DataType"/>
</AppliesTo>
<TaggedValues>
<Tag name="technical mapping" type="" description="" unit="" values="" default=""/>
<Tag name="default size" type="" description="" unit="" values="" default=""/>
<Tag name="default precision" type="" description="" unit="" values="" default=""/>
<Tag name="default format" type="" description="" unit="" values="" default=""/>
<Tag name="default initial value" type="" description="" unit="" values="" default=""/>
</TaggedValues>
</Stereotype>
</Stereotypes>
<TaggedValueTypes>
<TaggedValueType property="business item" description="" notes="Type=RefGUID;Stereotypes=EDD_BusinessItem;"/>
<TaggedValueType property="logical datatype" description="" notes="Type=RefGUID;Stereotypes=EDD_LogicalDatatype;"/>
</TaggedValueTypes>

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8599
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #11 on: March 29, 2020, 11:35:16 am »
Thanks, Geert, but that seems only to work for RefGuids.  (it may be the one you posted earlier to help me with the my RefGuid issue.)

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

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8066
  • Karma: +118/-20
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #12 on: March 30, 2020, 08:30:16 am »
The good news is that I think the issue I was describing has been fixed. I'm still going to explain what used to be the case, and hopefully my example technology will allow you to define the types that you need.

Code: [Select]
<?xml version="1.0"?>
<MDG.Technology version="1.0">
<Documentation id="ProfileA" name="TagTest" notes="TagTest" version="1"/>
<UMLProfiles>
<UMLProfile profiletype="uml2">
<Documentation id="BEE021DB-C" name="ProfileA" notes="ProfileA" version="1.0"/>
<Content>
<Stereotypes>
<Stereotype name="S" notes="">
<AppliesTo>
<Apply type="Class"/>
</AppliesTo>
<TaggedValues>
<Tag default="" description="" name="Spinner" type="int" unit="" values=""/>
</TaggedValues>
</Stereotype>
</Stereotypes>
<TaggedValueTypes/>
<ViewDefinitions/>
<Metamodel/>
</Content>
</UMLProfile>
<UMLProfile profiletype="uml2">
<Documentation id="E21F8CB8-4" name="ProfileB" notes="ProfileB" version="1.0"/>
<Content>
<Stereotypes>
<Stereotype name="S" notes="">
<AppliesTo>
<Apply type="Class"/>
</AppliesTo>
<TaggedValues>
<Tag default="" description="" name="Spinner" type="int" unit="" values=""/>
</TaggedValues>
</Stereotype>
</Stereotypes>
<TaggedValueTypes/>
<ViewDefinitions/>
<Metamodel/>
</Content>
</UMLProfile>
</UMLProfiles>
<TaggedValueTypes>
<RefData exporter="EA.25" version="1.0">
<DataSet filter="Property='#Property#'" name="Property Types" table="t_propertytypes">
<DataRow>
<Column name="Property" value="Spinner"/>
<Column name="Description" value="Spinner"/>
<Column name="Notes" value="Type=Spin;"/>
</DataRow>
</DataSet>
</RefData>
</TaggedValueTypes>
</MDG.Technology>

In that technology I have two profiles that are identical except for id and name. id being a portion of a guid.

I set the technology id to the same as the first profile name. My expectation was that defined tagged value would only work in that profile.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8599
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #13 on: March 30, 2020, 05:43:06 pm »
The good news is that I think the issue I was describing has been fixed. I'm still going to explain what used to be the case, and hopefully, my example technology will allow you to define the types that you need.

[SNIP]

In that technology, I have two profiles that are identical except for id and name. id being a portion of a GUID.

I set the technology id to the same as the first profile name. My expectation was that defined tagged value would only work in that profile.
Thanks,  A few questions.

Where has it been fixed?  In an, as yet, unreleased version or in the current release?

Where did your Tag come from, the general set (selected in the Tagged Values dialog of the generator) or within the metamodel itself?

I can't see any functional difference between your Technology & Profile specification and mine, can you?

Yours appears to have worked, mine didn't.

Paolo

[Edit: Checking your output showed me that your <TaggedValueTypes> section was OUTSIDE the profile section.  Whereas what I was reporting was inside the profile <TaggedValueTypes/>

So after carefully rechecking my output, I found that EA had actually worked, but put it "ugly printed" way off to the right of the screen and therefore not visible.  Also, strangely (and for reasons unknown to me) BETWEEN two profiles.  I had to "pretty print" it a number of times before things fell into place.  But my selected tags are there!

Given that they are outside the profiles in both cases, your expectation is now suspect, don't you agree?  Perhaps they apply to ANY profile in that technology,m but not outside?]

Paolo - using EA in spite of EA, NOT because of it.
« Last Edit: March 30, 2020, 05:57:37 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8066
  • Karma: +118/-20
    • View Profile
Re: Profile Tag Definition versus General Tag definition
« Reply #14 on: March 31, 2020, 08:32:59 am »
I think you've answered most of your questions.

So after carefully rechecking my output, I found that EA had actually worked, but put it "ugly printed" way off to the right of the screen and therefore not visible.  Also, strangely (and for reasons unknown to me) BETWEEN two profiles.  I had to "pretty print" it a number of times before things fell into place.  But my selected tags are there!
Sounds extremely odd. I can't explain how that would happen either. All the profiles should have a common parent element in the xml. I've never seen a technology generated in anything other than a fixed order for its components.

Given that they are outside the profiles in both cases, your expectation is now suspect, don't you agree?  Perhaps they apply to ANY profile in that technology,m but not outside?
Yes, that was how I suspected the behavior must have been fixed. Personally I believe that is appropriate behavior, I wouldn't want every untyped tag I see to be given an inappropriate type just because I use a technology somewhere that uses that tag name.