Book a Demo

Author Topic: Using RefGUID Tagged Value Type in Code Templates  (Read 2368 times)

Roland Tucker

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Using RefGUID Tagged Value Type in Code Templates
« on: January 21, 2009, 12:04:19 pm »
I'm attempting to associate a class attribute with an operation so that when generating code I can use this attributes name in a Get and Set property using the VBNet Operation Body (property) code template.  Currently I can use opTag:"attribute_name", but I would rather associate with the actual attribute, thus handling any attribute name changes and making selecting the attribute for the operation easier in the tagged values.

So far ...
I've added the following Tagged Value Type called ClassMethodAttribute:

Type=RefGUID;
Values=Attribute;
Stereotypes=private variable;
AppliesTo=Operation;

Works fine (btw: "private variable" is a sterotype I created for the attributes), but now how can I use the attributes GUID in a Code Template to extract the attributes name (ie. attName).

Thanks

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Using RefGUID Tagged Value Type in Code Templa
« Reply #1 on: January 22, 2009, 08:27:41 am »
Code templates currently only access the real value for a tagged value, not the display value.

To get the corresponding name you would need to make an add-in call using EXEC_ADD_IN to call Repository.GetAttributeByGUID.

Roland Tucker

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Using RefGUID Tagged Value Type in Code Templa
« Reply #2 on: January 22, 2009, 11:41:03 am »
Thank you