Book a Demo

Author Topic: How to create a structured tagged value via scripting  (Read 3351 times)

Russell

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
How to create a structured tagged value via scripting
« on: September 26, 2018, 09:50:45 pm »
Hi,

I'd like to be able to create structured tagged values on an element via scripting.  I see various examples of doing this for simple tags, but not for structured tags.

When I inspect taggedValue objects for existing structured tag value types that I've created via the GUI, using http://sparxsystems.com/enterprise_architect_user_guide/13.0/automation/taggedvalue.html as a reference, then I can't see where the "Detail" that actual describes the structure is stored.

For example, if I want to create a tagged value with structure "Type=Boolean; Default=False", where do I set/get that from?  Setting against Value or Notes doesn't work, and there is no Detail attribute.

Can someone please point me in the right direction.

Thanks

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to create a structured tagged value via scripting
« Reply #1 on: September 26, 2018, 10:02:26 pm »
I'm guessing you want to create the tagged value type rather then an actual tagged value.

If that is the case then you should be looking at EA.PropertyType.

This is the code I use to create tagged value types:

Code: [Select]
        public void addTaggedValueType(string tagName, string tagDescription, string tagDetail)
        {
            global::EA.PropertyType taggedValueType = (global::EA.PropertyType)this.wrappedModel.PropertyTypes.AddNew(tagName, "");
            taggedValueType.Description = tagDescription;
            taggedValueType.Detail = tagDetail;
            taggedValueType.Update();
        }

this.wrappedModel = EA.Repository

Geert