Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: M.SoddSliver on April 13, 2010, 05:57:22 pm

Title: Tagged Values of parameters
Post by: M.SoddSliver on April 13, 2010, 05:57:22 pm
I'm writing an Add-In for EA 7.1. In this template we do several transformations. For one of these transformations I would like to use the tagged value of a parameter. In the EA GUI it's possible to set these tagged values. However, I can't seem to find a collection in the parameter com object.

Can anyone tell me how I can access these tagged values from code?
Title: Re: Tagged Values of parameters
Post by: M.SoddSliver on April 13, 2010, 06:17:42 pm
Stupid me, I see the same question in the topic list now! Couldn't find it with the search function though. I have my answer :)
Title: Re: Tagged Values of parameters
Post by: Geert Bellekens on April 13, 2010, 06:18:29 pm
I think you are right that they are not exposed through the API.
You can however read their values trhough an SQL query. (Repository.SQLQuery)
They are stored in the t_taggedvalue table with BaseClass = 'OPERATION_PARAMETER'

Geert
Title: Re: Tagged Values of parameters
Post by: Geert Bellekens on April 13, 2010, 06:19:26 pm
Quote
Stupid me, I see the same question in the topic list now! Couldn't find it with the search function though. I have my answer :)

You have to use the search button on the top left. That works a lot better then the search box on the top right.

Geert
Title: Re: Tagged Values of parameters
Post by: M.SoddSliver on April 13, 2010, 06:21:30 pm
Thanks a lot! :) I will check out that SQL statement.
Title: Re: Tagged Values of parameters
Post by: M.SoddSliver on April 13, 2010, 06:57:19 pm
I have built up the query, and here is a copy of the result:

  <?xml version="1.0" ?>
- <EADATA version="1.0" exporter="Enterprise Architect">
- <Dataset_0>
- <Data>
- <Row>
  <PropertyID>{45E7C16C-AF52-47ee-BEA2-3003A5604971}</PropertyID>
  <ElementID>{EC9879F8-E633-40bb-99BC-4223E6AC2079}</ElementID>
  <BaseClass>OPERATION_PARAMETER</BaseClass>
  <TagValue>ReturnType</TagValue>
  <Notes>Object</Notes>
  </Row>
  </Data>
  </Dataset_0>
  </EADATA>

I have several problems with this result:

- The TagValue doesn't represent the value of the tag but the TagName
  I can't find the actual value of the tag? Any idea or query to retrieve this value?
- Also the default value for notes seems to be 'Object', however, I did add actual notes! Any idea? They must be stored somewhere in the database
Title: Re: Tagged Values of parameters
Post by: Geert Bellekens on April 13, 2010, 07:13:18 pm
What kind of tagged value did you use?
In my test case I just typed the name of the tagged value and a text value.
The name indeed appeared in the tagValue column, and the value appeared in the notes column.

But I can imagine, that if you have a RefGUID type of tagged value that this is stored differently.

Geert
Title: Re: Tagged Values of parameters
Post by: M.SoddSliver on April 13, 2010, 08:21:00 pm
It does work now :) Thanks for the input. The notes column does contain exactly what i want to have.