Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Boron on September 14, 2018, 11:58:39 pm

Title: Create read-only tag in an UML profile
Post by: Boron on September 14, 2018, 11:58:39 pm
Hello,
does anybody know how to make a tag read-only?

We created an own UML profile with some stereotypes for classes.
For one stereotype I would like to make one tag "read-only". The tag has a default value, and it would be nice if the user, who creates a class of such a stereotype cannot change the value of that tag.
Title: Re: Create read-only tag in an UML profile
Post by: Mauricio Moya (Arquesoft) on September 15, 2018, 03:18:52 am
You can create a workflow script that return false to method CanEditTag when the name of the tag match your criteria.
Title: Re: Create read-only tag in an UML profile
Post by: Eve on September 17, 2018, 09:16:18 am
Predefined Structured Types (http://www.sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/predefinedtaggedvaluetypes.html)
Quote
Code: [Select]
Type=Const;
Default=Val;
Used to: Create a read-only constant value.

To include this in a profile, see With Predefined Tag Types (http://www.sparxsystems.com/enterprise_architect_user_guide/14.0/modeling_tools/definestereotypetagswithsu2.html).
Title: Re: Create read-only tag in an UML profile
Post by: Boron on September 18, 2018, 04:45:35 pm
Simons approach worked well.
Many thanks for that.