Book a Demo

Author Topic: Adding tagged values to certain elements  (Read 42136 times)

ducatiross

  • EA User
  • **
  • Posts: 114
  • Karma: +1/-0
    • View Profile
Re: Adding tagged values to certain elements
« Reply #15 on: December 20, 2014, 03:13:57 am »
Thanks q. I will.

RIL

  • EA User
  • **
  • Posts: 164
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: Adding tagged values to certain elements
« Reply #16 on: December 23, 2014, 07:51:33 am »
Hi qwerty,

Regarding Synchronization of TVs : Is there a way to call Syncronize Stereotypes for model Elements via VBScript?

In my case I need it for AssociationEnds (which is missing in the menu in EA10).

// Rolf Lampa
-- There's always a solution --

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Adding tagged values to certain elements
« Reply #17 on: December 23, 2014, 08:22:06 am »
Hi Rolf,
I'm not sure about the AssociationEnds (we discussed this in a different thread, didn't we?) since I forgot the outcome (my ultra short time memory). However, IIRC in V10 the new behavior was already present so a synch would not be necessary. You might try the Repository method
Code: [Select]
bool SynchProfile (string Profile, string Stereotype) anyway to see whether it has an effect.

q.

RIL

  • EA User
  • **
  • Posts: 164
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: Adding tagged values to certain elements
« Reply #18 on: December 23, 2014, 09:16:36 am »
Hi again qwerty,

Thank you for your reply. For some reason "Repository.SynchProfile" applies the (role) Stereotype on the Association itself instead of on the AssociationEnds (Roles). (This is the old problem I tried to solve already a year ago).

However, I finally got the following code to work (poking directly on the role), like so:

Code: [Select]
link.SupplierEnd.StereotypeEx = "my stereotype"
What I had tried, which did NOT work, was this:
Code: [Select]
link.SupplierEnd.Stereotype = "my stereotype"
(that is, "Stereotype" instead of "StereotypeEx".

What does "...Ex" stand for?

// Rolf Lampa
« Last Edit: December 23, 2014, 09:17:43 am by Rolf_Lampa »
-- There's always a solution --

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Adding tagged values to certain elements
« Reply #19 on: December 23, 2014, 09:54:46 am »
Ex stands probably for EXtended. I know that for classes it returns the comma separated list of all stereotypes set for the class (what if you have a stereo with comma inside??). Well, that's just one of those strange things a bad architect did allow to be coded in EA :-( It's kind of voodoo. In Attributes for example you need to supply StereotypeEx instead of Stereotype. Strange enough there's also a GetStereotypeList method (yuck).

q.
« Last Edit: December 23, 2014, 09:55:42 am by qwerty »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Adding tagged values to certain elements
« Reply #20 on: December 24, 2014, 08:54:50 am »
Quote
... (what if you have a stereo with comma inside??). Well, that's just one of those strange things a bad architect did allow to be coded in EA :-(
What would happen to UML if you had a comma in the stereotype? The diagram notation has the exact same issue. For the standard serialization format it's flat out illegal.

Sure, a comma separated list requires more work for the client to split apart, but that's not my biggest regret of that API function; that's the inability to tell the difference between a BPMN1.1::Pool and a BPMN2.0::Pool. Both just list Pool. Shape scripts handle this particular issue much better. The condition HasProperty("stereotype", "BPMN2.0::Pool") queries the entire list of stereotypes for a matching stereotype. In this case it's looking in a single profile, but even better. If any stereotype (including from another profile) extends the requested stereotype it will match that too. Of course given that shape scripts are only applied using a stereotype this only useful for multiple stereotypes and the child element or related element scripts.
« Last Edit: December 24, 2014, 08:56:29 am by simonm »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Adding tagged values to certain elements
« Reply #21 on: December 24, 2014, 09:36:25 am »
Simon,
the fact that the UML/OhMyGod guys did a bad job must not mean a tool developer must adopt it. There's a well know construct called collection which would perfectly suit returning a list of stereotypes. However, don't let us get upset about such minor tidbits. I tend to pour salt in open wounds. Eventually, I learned in the past, people tend to cure those wounds once there's enough salt being poured out.

Merry Christmas to you and the other guys down under :)

q.

SpencerSkelly

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Adding tagged values to certain elements
« Reply #22 on: March 27, 2024, 05:39:14 am »
I found a fairly simple way to add tags to everything in a package:

CSV Import/Export
Make sure you add the tag value to the export specification (add tagged value, select the element with that tag, add the tag as a field), when you import that file into the package (make sure you have the GUIDs) it adds those tags to all elements.

Another method I've been using is through generalization, but it can take some management...
All parts are categorized, those categories can all be categorized, say, as hardware.
Hardware can have P/N, Cost, Length, etc, allowing inheritance of those tags