Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: adepreter on December 19, 2011, 07:44:44 pm
-
Hello,
When we update a UML profile, is there any way to avoid the existing tag values to be lost?
Even when we simply add a tag value in our profile, the existing tag values (in our huge model) get lost when we re-apply the profile.
Thanks
Alain
-
Not sure whether this behaviour is a bug....
But to rescue your tags you can dump the table t_objectproperties and restore the contents later. That should do it.
q.
-
Let's describe the problem with a concrete example:
1) Create a profile "MyProfile" that includes
- Stereotype "Logical Application Component", that includes
- Tag "Lifecycle", that is of
- Enumerated type: "Undefined, Envision, Development"
and where the default value is "Envision"
2) In a model "My Model",
- Import the profile "My Profile"
- Apply the stereotype to a component called "My Application"
- Set the "Lifecycle" tag to the value "Production"
3) In the profile "My Profile",
- Update the enumerated type by adding the value "Retired"
Now the Enumerated type looks like this:
Enumerated type: "Envision, Development, Production, Retired"
4) Import/Reapply the profile "My Profile" in the model "My Model"
Problem:
- "My Application" does not have the "Retired" value (Indeed, I can see this also in the table t_objectproperties)
- If, as an alternative, I reapply the stereotype to "My Application" then all tag values are set to the default value "Envision" (al my values are lost)
So, to summarize, are there any Sparx features, tools, scripts, snippets... that can be used to manage the lifecycle of UML profiles AND of the models that apply these profiles?
Thanks
Alain
-
When you say "Import the profile", what exactly do you mean? Do you use the import into the resource?
q.
-
In the Resources view, right-click the stereotype and "Synch Tagged Values and Constraints". That will update the tag definitions for each stereotype instance without resetting the tagged values to their defaults.
-
Thank you. That works! :)
-
In the Resources view, right-click the stereotype and "Synch Tagged Values and Constraints". That will update the tag definitions for each stereotype instance without resetting the tagged values to their defaults.
Is there any way to do this through the API? Stereotypes don't have any relevant method.
Also I cannot find a way to apply all the tagged values of a stereotype to an element that has the stereotype applied.
EDIT:
Well, managed to find it, the repository has a SynchProfile operation, passing the profile and stereotype names as strings. The documentation is not very easy to navigate, lots of broken links.