I have a tag defined ONLY in my Profile. I use the tag in two different metatypes. Is it the same tag? I don't mean instances of the same tag since they obviously are (and EA conveniently provides a structured GUID that says the two instances came from my profile - thanks to qwerty for identifying that).
Following advice from (Sparxian) Eve, I'm playing with having multiple stereotypes against an item. Previously, we had a rule one metatype = one stereotype. I'm testing out the concept that there is still one stereotype to define/identify the metatype, but there are supplemental stereotypes to "enhance" metatype with additional information.
I have a metatype "Organisation" which may or may not be a legal entity. If it is not a legal entity, I want to add the property that references the legal entity to which it belongs. So I created a supplemental stereotype "NOTLegalEntity" to which was attached the property LegalEntityReference (RefGUID). I created a simple Organisation and then added the supplemental stereotype and used the toolbox to "Synchronize Stereotype". Lo and behold! The item gained the additional property!
Flushed with success, I decided to push my luck! Organisation items have a property "IsLegalEntity" to managed whether it is or not. In the Organisation metatype in the MDG, the value of the property is extrinsically set to «Uninitialized», the user has to set it to True or False as required. It seemed to me that if I set the supplemental stereotype to "NOTLegalEntity" then I am explicitly setting the value of the "IsLegalEntity" to False! So I set up the Tag in the supplemental stereotype to set the value to False. [NOTE: I may not be using the correct syntax - but that's another story for the present].
I resynchronized the stereotype and EA said it added the Tag. And that's what it did!
I was expecting that EA would say "you already have a Tag "IsLegalEntity" which has a value, I'm NOT overwriting it!" I was hoping EA would overwrite the default value with the value I supplied (False). What I wasn't expecting was that I would now have two tags with name "IsLegalEntity", one with the value «Uninitialized», the other with the value False! Obviously, EA is saying they aren't the same tag because (in the absence of any other instruction) they came from different stereotypes. I can't really argue with that. Some experimentation proves that the property GUID contains encoding to determine which value belongs to (not only which profile but also) which stereotype.
My question, therefore, is, from my user perspective, is there any syntax that I can provide that says the Tag I reference in "NOTLegalEntity" is the same Tag I created in "Organisation" in the MDG. Since I can't decode the GUID, I can't write a process that would rectify things after the effect.
TIA,
Paolo
[EDIT: I have now determined that, as many people have suggested, where you have multiple tags, EA will always return the first one it finds. Thus, regardless of which stereotype the tag is actually assigned to, the shapescript will pick up (apparently) the first one it finds, even though conceptually (and physically) it is NOT assigned to that stereotype! Sparxians, if you are going to encode the stereotype in the GUID then you need to use it to select the CORRECT ONE for the shapescript!]