Author Topic: Automate Opening the Version Control Settings Window  (Read 1086 times)

ahafez

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Automate Opening the Version Control Settings Window
« on: May 19, 2020, 09:36:13 pm »
Hello All,

I want to open the "Version Control Settings" window from a C# add-in, is there an API to do that?

Thanks,
Ahmed Hafez

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10524
  • Karma: +358/-31
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automate Opening the Version Control Settings Window
« Reply #1 on: May 19, 2020, 09:37:55 pm »
No, I don't think so.

Geert

ahafez

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Automate Opening the Version Control Settings Window
« Reply #2 on: May 19, 2020, 10:07:01 pm »
Hello Geert,

Many thanks for your fast reply.

Do you think is there a workaround to do so?

Thanks,
Ahmed Hafez

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10524
  • Karma: +358/-31
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automate Opening the Version Control Settings Window
« Reply #3 on: May 19, 2020, 10:39:33 pm »
Hello Geert,

Many thanks for your fast reply.

Do you think is there a workaround to do so?

Thanks,
Ahmed Hafez
Depends, what do you want to achieve?
Do you really want to open the version control settings dialog, or do you want to allow the user to set the version control settings.

In the latter case you could make your own dialog, get the input from the user and then set the version control settings from your add-in.
Some of these are stored in the database, some in the paths.txt in the user profile (%appdata%)

Geert

ahafez

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Automate Opening the Version Control Settings Window
« Reply #4 on: May 20, 2020, 12:34:39 am »
Hello Geert,

I am looking to open the version control settings dialog, to ask the user to complete the missing configuration, which I found in the paths.txt file.

Thanks,
Ahmed Hafez

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10524
  • Karma: +358/-31
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automate Opening the Version Control Settings Window
« Reply #5 on: May 20, 2020, 02:17:43 am »
Hello Geert,

I am looking to open the version control settings dialog, to ask the user to complete the missing configuration, which I found in the paths.txt file.

Thanks,
Ahmed Hafez
Isn't that standard behavior? If you open EA with missing configurations EA will show a popup that asks you to fill in the missing config.
If you click Yes, EA opens the dialog.
I don't understand why you would want to replicate that.

Geert

ahafez

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Automate Opening the Version Control Settings Window
« Reply #6 on: May 20, 2020, 02:37:05 am »
Hello Geert,

The goal of my add-in is to collect the errors and advice the user hot to fix it.

By the way I could also will need to open other EA dialog for fixing the other issues. That is way I need to know a way to open specific EA dialog.

Thanks,
Ahmed Nabil

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10524
  • Karma: +358/-31
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automate Opening the Version Control Settings Window
« Reply #7 on: May 20, 2020, 03:58:29 am »
Hello Geert,

The goal of my add-in is to collect the errors and advice the user hot to fix it.

By the way I could also will need to open other EA dialog for fixing the other issues. That is way I need to know a way to open specific EA dialog.

Thanks,
Ahmed Nabil
I'm afraid most of the dialogs are not accessible from the API.
You might be able to do some stuff by simulating keypresses, but that is notoriously unreliable.

Geert

ahafez

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Automate Opening the Version Control Settings Window
« Reply #8 on: May 20, 2020, 05:01:05 am »
Hello Geert,

I agree with you the only way that I found is the Simulating Keyboard Input using SendKeys.SendWait but that will not be a stable solution.

Thanks,
Ahmed Hafez

qwerty

  • EA Guru
  • *****
  • Posts: 11471
  • Karma: +304/-263
  • I'm no guru at all
    • View Profile
Re: Automate Opening the Version Control Settings Window
« Reply #9 on: May 20, 2020, 05:22:24 am »
There also the hidden Respository.CustomCommand which might (!) do it. It could take a "SEC" parameter, but it's just poking in the mist. If that would work: please let us know ;-)

q.

ahafez

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Automate Opening the Version Control Settings Window
« Reply #10 on: May 20, 2020, 08:28:08 pm »
Hello qwerty,

Many thank for your help, but is there a way two find this secret parameter?  ;)


Uffe

  • EA Practitioner
  • ***
  • Posts: 1815
  • Karma: +122/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Automate Opening the Version Control Settings Window
« Reply #11 on: May 20, 2020, 08:37:33 pm »
I tried adding parameters from the corresponding EA Command hyperlink to CustomCommand(). No good.

Probably not doing it right, but then again, it's undocumented so what's right? Anyway, I only spent five minutes on it. Could still be a way.
My theories are always correct, just apply them to the right reality.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10524
  • Karma: +358/-31
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automate Opening the Version Control Settings Window
« Reply #12 on: May 20, 2020, 08:45:13 pm »
Hello qwerty,

Many thank for your help, but is there a way two find this secret parameter?  ;)
They only way really (except for guessing) is to get them from a Sparx Systems employee.
We know a couple of uses because someone from Sparx shared them with us.
Opening the version control settings dialog is not one of those known uses.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 11471
  • Karma: +304/-263
  • I'm no guru at all
    • View Profile
Re: Automate Opening the Version Control Settings Window
« Reply #13 on: May 20, 2020, 09:59:37 pm »
You call that like
Code: [Select]
xmlres = Respository.CustomCommand(
  "CFormCommandHelper", "ProcessCommand",
  "Dlg=" + dlg + ";id=" + id + ";hwnd=" + hwnd);
where dlg could eventually be "SEC" (who knows except Sparx?). The ones we know so far are PKG, ELM, ATT, OP, and DGM. Maybe that's just it. Anyhow, why Sparx keeps that a secret function is one of the big questions of the universe. Doesn't do harm and could well be documented. Alas, that's how it is. There are more uses for this operation, but targeting something completely different.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 10524
  • Karma: +358/-31
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automate Opening the Version Control Settings Window
« Reply #14 on: May 20, 2020, 10:57:25 pm »
There's also

Code: [Select]
Repository.CustomCommand "Repository", "SynchProfile", "Profile=" & profile & ";Stereotype=" & stereotype & ";"
to synchronize a stereotype

Geert