Book a Demo

Author Topic: Is it possible to interrogate a "live" Profile from a script?  (Read 3803 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Again, I suspect I know the answer, but I thought I'd check first.

I'm interested in iterating through the list of stereotypes in a given profile (so that I can automagically synchronize them with Repository.SynchProfile).

Repository.SynchProfile doesn't synchronize the profile, it synchronizes a Profile Item (as per Help system) - so why not name it SynchProfileItem?  Just a thought...

It would be good if Repository.SynchProfile(<Profilename>, "*") would automatically synchronize all the stereotypes in the profile, but...

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Is it possible to interrogate a "live" Profile from a script?
« Reply #1 on: April 12, 2021, 04:52:17 pm »
Only by reading the xml file content I'm afraid.

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Is it possible to interrogate a "live" Profile from a script?
« Reply #2 on: April 12, 2021, 04:54:24 pm »
Only by reading the xml file content I'm afraid.

Geert
Thanks Geert,
 as I suspected...

Out of interest, have you done it?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Is it possible to interrogate a "live" Profile from a script?
« Reply #3 on: April 12, 2021, 05:06:47 pm »
Only by reading the xml file content I'm afraid.

Geert
Thanks Geert,
 as I suspected...

Out of interest, have you done it?

Paolo
Only to get the shapescripts, and the scripts IIRC.
I don't think I ever managed to read MDG's stored in the model though.

https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Framework/Tools/Script%20Management/ExtractShapescriptsFromMDG.vbs

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Is it possible to interrogate a "live" Profile from a script?
« Reply #4 on: April 12, 2021, 05:30:38 pm »
[SNIP]
Only to get the shapescripts, and the scripts IIRC.
I don't think I ever managed to read MDG's stored in the model though.

https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Framework/Tools/Script%20Management/ExtractShapescriptsFromMDG.vbs

Geert
Thanks, Geert,

I've since realised I need only those currently in use in the specific repository, so I'll need to use a different mechanism (probably get a collection by query) and process that.  Any given repository will likely have only a small proportion of the complete set of metatypes we could use.

Paolo
« Last Edit: April 12, 2021, 05:32:38 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!