Book a Demo

Author Topic: Custom attributes  (Read 3288 times)

Serguei

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Custom attributes
« on: November 05, 2008, 11:49:29 pm »
Hello,

I'm developing EA add-in and have some questions.

1. Is it possible to add to a project (repository/model) custom attributes of string type?
Is it possible at the classes/associations/etc elements too?
I.e. "MyProperty"="My custom value"

2. How can I get file name (with path) of currently loaded project using automated interface?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Custom attributes
« Reply #1 on: November 06, 2008, 05:47:08 am »
I'm not sure about (all cases of) question 1, but why not try tagged values?

As for question 2, read the Repository.ConnectionString property. In the case of an EAP file the file name is returned.
No, you can't have it!

Serguei

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Custom attributes
« Reply #2 on: November 10, 2008, 10:51:02 pm »
Quote
I'm not sure about (all cases of) question 1, but why not try tagged values?
As I know there is no tagged values for higher level objects like repository or model.
I explore repository.Models(i).Element property for tagged values but all models have "Element" attribute equals to NULL (and empty Elements collection).

Any suggestions to save custom settings of model level? :-?

Quote
As for question 2, read the Repository.ConnectionString property. In the case of an EAP file the file name is returned.
Thank you, it works.

RealAlex

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: Custom attributes
« Reply #3 on: November 19, 2008, 11:29:28 pm »
I don't know if it would work, but you could create a table for storing that information, something like
EA_GUID - property_name -  value

and then use Repository.SQLQuery to retrieve that information...