Author Topic: Access to the repository.  (Read 2308 times)

abvgd

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Access to the repository.
« on: September 30, 2021, 06:29:22 pm »
Hello. I'm just getting into working at EA.
I can't figure out how to make an add-in that will fetch information about the model from the repository? For example, model version.
Please share the official documentation and source code examples, if anyone has any.
Thanks in advance.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11315
  • Karma: +422/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Access to the repository.
« Reply #1 on: September 30, 2021, 06:42:22 pm »
Where do you see model version in EA?

Geert

abvgd

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Access to the repository.
« Reply #2 on: September 30, 2021, 07:27:23 pm »
Wrote it wrong.
Not the version of the model, but any information about the model in EA. Number of elements, date of last change, project name. Anything that is stored in the repository.
This can be obtained using scripts in EA or using addin. I understand correctly? Here I am interested in the second option.
If I say something wrong, I'm sorry.

qwerty

  • EA Guru
  • *****
  • Posts: 12449
  • Karma: +348/-291
  • I'm no guru at all
    • View Profile
Re: Access to the repository.
« Reply #3 on: September 30, 2021, 08:27:35 pm »
Pretty high shot for the first one. I'd recommend you get acquainted with EA's API (and database) first. You can retrieve lots of information, but it will take some study first.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 11315
  • Karma: +422/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Access to the repository.
« Reply #4 on: September 30, 2021, 08:27:54 pm »
"anything" is really a bit broad  ;)

For the number of elements, you'll have to count the records in t_object
Code: [Select]
select count(*) as nbrOfElements from t_objectand execute that using Repository.SQLQuery

For the latest date of change, you can query the ModifiedDate on t_object the same way.

A project doesn't really have a name. It does have a GUID though, you can get that through Repository.ProjectGUID.

You can find all info about the API here: https://sparxsystems.com/enterprise_architect_user_guide/15.2/automation/reference.html

I have a bunch of scripts on Github that you can use as example: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library

Geert
« Last Edit: September 30, 2021, 08:52:02 pm by Geert Bellekens »

abvgd

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Access to the repository.
« Reply #5 on: September 30, 2021, 08:34:39 pm »
Pretty high shot for the first one. I'd recommend you get acquainted with EA's API (and database) first. You can retrieve lots of information, but it will take some study first.

q.
Thx!

abvgd

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Access to the repository.
« Reply #6 on: September 30, 2021, 08:36:00 pm »
"anything" is really a bit broad  ;)

For the number of elements, you'll have to count the records in t_object
Code: [Select]
select count(*) as nbrOfElements from t_objectand execute that using Repository.SQLQuery

For the latest date of change, you can query the ModifiedDate on t_object the same way.

A project doesn't really have a name. It does have a GUID though, you can get that through Repository.ProjectGUID.

You can find all info about the API here: https://sparxsystems.com/enterprise_architect_user_guide/15.2/automation/reference.html

I have a bunch of scripts on Github that you can use as example: https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library

Geert

Geert
Thank you, I will understand!