Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: rmartinezb on November 11, 2016, 02:03:37 am

Title: Custom Tagged Values by C# addin
Post by: rmartinezb on November 11, 2016, 02:03:37 am
Hi,

I'm programming an addin that generate some Archimate elements and I need to create some TV for each elements, but I need that some of them be read only.
How can I do that? I know how to create tagged values, but don't how to manage tagged value types through the automation interface. Any tip?
Title: Re: Custom Tagged Values by C# addin
Post by: qwerty on November 11, 2016, 07:13:31 am
The default tagged values are stored in Repository.PropertyTypes. But I don't get what you mean by r/o.

q.
Title: Re: Custom Tagged Values by C# addin
Post by: rmartinezb on November 11, 2016, 08:02:13 pm
I want to create tagged values through the API that can not be edited by EA users.

I would really use any system that save key / value pairs on elements that can not be edited by users, it does not have to be done using tagged values.
Title: Re: Custom Tagged Values by C# addin
Post by: qwerty on November 11, 2016, 08:17:36 pm
AKAIK you can not prevent users from altering TVs only. If you can modify an element you can also modify a TV. You might write an add-in that checks for alteration (though not sure if you get a notification for altered TVs).

You should look into RefGUID TVs. These are linked to stereotyped elements so one can only select from a list. Also a simple drop-down is a possibility if you want to prevent people from typing random text in the TV values.

q.
Title: Re: Custom Tagged Values by C# addin
Post by: Eve on November 14, 2016, 09:26:58 am
http://sparxsystems.com/enterprise_architect_user_guide/13.0/modeling_tools/predefinedtaggedvaluetypes.html (http://sparxsystems.com/enterprise_architect_user_guide/13.0/modeling_tools/predefinedtaggedvaluetypes.html)

Quote
Type=AddinBroadcast;
Values=YourAddinName;

Used to: Allow an Add-In to respond to an attempt to edit this Tagged Value by showing a dialog in which the value and notes can be edited.

Quote
Type=Const;
Default=Val;

Used to: Create a read-only constant value.