Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: r2 on April 17, 2018, 07:31:16 pm

Title: How to update/ synchronize applied stereotypes?
Post by: r2 on April 17, 2018, 07:31:16 pm
Hi,

I have an EA profile and a toolbox with several stereotypes which I applied in the model. Now I updated the name, color and properties of the stereotypes in my profile, saved the toolbox and re-imported the updated MDG technology XMI file into the model. How do I update the existing elements in the model automatically? Is there a chance without a script? I assume since I changed the name of the (same) stereotype, there is no mapping between the elements.

Thanks
Title: Re: How to update/ synchronize applied stereotypes?
Post by: qwerty on April 17, 2018, 08:47:53 pm
Just go to your stereotype in the toolbox and choose Synch from the context menu. Note that it only adds new TVs and does not remove existing ones.

q.
Title: Re: How to update/ synchronize applied stereotypes?
Post by: r2 on April 17, 2018, 09:24:24 pm
Well, if I use synch stereotype nothing happens apart from the tagged values. But I want to update the existing applied stereotypes in total, eg. <<name_old>> --> <<name_new>>, old color --> new color and so on. Any idea?

r2
Title: Re: How to update/ synchronize applied stereotypes?
Post by: qwerty on April 17, 2018, 10:34:52 pm
You need to script that. EA has no idea that you change the name of a stereotype. So you need to run a script which knows about that. It's best anyway to have a new version of your profile and shift existing ones to the new. A change to a stereotype is not trivial and should only be made after well thinking about it, never on the fly.

q.
Title: Re: How to update/ synchronize applied stereotypes?
Post by: Uffe on April 17, 2018, 11:56:59 pm
A change to a stereotype is not trivial and should only be made after well thinking about it, never on the fly.
This.

Now, someone who is somewhat familiar with EA might be forgiven for thinking that a stereotype's name is not its identity, since that's how most of EA works, but with stereotypes the (fully-qualified) name is in fact the identity. So you can't change it, what you're doing is deleting one stereotype and creating another. EA has no record of the change, and in fact no concept of a stereotype name change.

/Uffe
Title: Re: How to update/ synchronize applied stereotypes?
Post by: r2 on April 18, 2018, 01:34:06 am
A change to a stereotype is not trivial and should only be made after well thinking about it, never on the fly.
This.

Now, someone who is somewhat familiar with EA might be forgiven for thinking that a stereotype's name is not its identity, since that's how most of EA works, but with stereotypes the (fully-qualified) name is in fact the identity. So you can't change it, what you're doing is deleting one stereotype and creating another. EA has no record of the change, and in fact no concept of a stereotype name change.

/Uffe


Thanks for your feedback. So there is no stereotype specific GUID available to start from.. and the only chance is to use a script that runs by the name as identifier? Is there a UML tool on the market that supports to some extend such a stereotype updating mechanism?
Title: Re: How to update/ synchronize applied stereotypes?
Post by: qwerty on April 18, 2018, 01:54:05 am
No, there is no GUID. Stereotypes are held in EA's memory. When scripting use StereotypeEx for the FQN of the stereotype. Regarding tools: probably nothing or in price areas where I don't work.

q.