Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Tehila1 on May 26, 2014, 11:26:27 pm
-
I would like to automate the process of configuring EA with version control. (Project -> Version Control -> Version Control Settings window)
The API methods I've found are related to packages that were already controlled or after the configuration are set. I would like to automate the step before.
Is there a way to do so via API or it must be done manually?
Thanks in advance!
-
I think part of the configuration is stored in the model database, so you can insert the suitable data directly on the database. But another part of the settings is per user, so I suppose it is stored in a local file, so if you set the local file properly you can set the version control settings for a user.
-
You have to do four things to put a package under version control.
1. Set the unique ID in %APPDATA%\SPARX_Systems\EA\paths.txt
2. Use API VersionControlAdd(..)
3. Set the svn path in registry
HKEY_CURRENT_USER\Software\SPARX Systems\EA400\EA\Options\VC_SVNExePath
4. svn Timeout in registry (VC_TIMEOUT)
I hope it's all.
Helmut
-
Thank you Helmut for your quick and detailed reply.
I followed the instructions you've posted and would like to get explication about the first step;
I set the unique id and configuration settings such as type and path to svn folder in the %APPDATA%\SPARX_Systems\EA\paths.txt file.
Then I checked if the action is reflected in EA, by selecting Settings -> Local Directories and Paths.
The new path ,indeed, exist.
But the path is still not set as a configuration:
It does not exist among the configurations defined manually- which can be displayed on Project -> Version Control -> Version Control Settings window.
Therefore, when I invoke the 'VersionControlAdd' method, the exception message I get is : "No version control configuration matches '<unique id>'. "
What else should I do in order to set the local path as configuration?
Thanks in advance.
-
Hi,
the entry VCConfigs is set to:
<VCConfigs><Config><GUID>svn_ac4nns</GUID><LocalPath>%svn_ac4nns%</LocalPath><UserName/><Type>2</Type></Config></VCConfigs>
%svn_ac4nns% is my Unique Identifier.
Helmut
-
Should I create in addition a registry entry called 'VCConfigs' and set it with the appropriate value?
Thanks.
-
If I understand it right in VCConfigs is an entry for each Unique ID.
If you have one unique ID you can simply change my values. If you have more try it by using the EA Configuration Dialog.
By the way I haven't it done with the registry yet.
Helmut
-
I cannot find such an entry in the registry.
Should I define one or I misunderstand something?
-
If you set the Version Control settings with EA EA creates this entry and fills it with the configured UniqueIDs.
Just configure with EA and look in the registry. All the VC information is in EA400\EA\OPTIONS.
Here is the content for two Unique IDs.
<VCConfigs><Config><GUID>svn_ac4nns</GUID><LocalPath>%svn_ac4nns%</LocalPath><UserName/><Type>2</Type></Config><Config><GUID>test</GUID><LocalPath>%test%</LocalPath><UserName/><Type>2</Type></Config></VCConfigs>
Helmut
-
Digging in the registry I found only 2 entries owned by EA400\EA\OPTIONS : CALENDAR and FILTERS.
Any ideas?
-
Create a SVN provider manually. Then search the registry for VC_SVNExePath
q.
-
Looks peculiar. I deleted with EA one entry and nothing changed in the registry. May be it's a bit more complicated.
Helmut
-
Hu, yes. Deleting the registry entry and cleaning paths.txt still kept the entry. So where could that info be stored else?
q.
-
Found it: t_genopt holds an entry with AppliesTo = VCConfigs
That just leaves the question why it's also in the registry? Does not seem to make much sense if the repository holds a value which seems to supersede its meaning. Well, it's EA...
q.
-
Trying to implement the above I want to set the t_genopt entry of VCConfig.
How can I access and update this VCConfig entry? It is the 5th entry retrieved from the following query:
SELECT t_genopt.Option FROM t_genopt
Thanks.
-
To update the entry you need to
Repository.Execute ("UPDATE t_genopt ...") with what you need,
q.
-
You have to do four things to put a package under version control.
1. Set the unique ID in %APPDATA%\SPARX_Systems\EA\paths.txt
2. Use API VersionControlAdd(..)
3. Set the svn path in registry
HKEY_CURRENT_USER\Software\SPARX Systems\EA400\EA\Options\VC_SVNExePath
4. svn Timeout in registry (VC_TIMEOUT)
I hope it's all.
Helmut
I followed the instructions above; create a local path via the paths.txt, modify the registry entries. I also verify that the unique ID is exist in t_genopt.
When I try to add a package to version control via the VersionControlAdd() method, I get the following error: "Could not find connection to version control provider."
What is missing?
Thanks.
-
Might be a security issue. Have you checked that the user has write access to the VC repo?
q.
-
Might be a security issue. Have you checked that the user has write access to the VC repo?
q.
I don't think it is a security issue. When I do this procedure manually- all right.
The configuration is still not set correctly despite the local path exists.
The package control options dialog looks like this:
Version Control : configName: (requires configuration)
File Name : %configName%\packageName.xml
Any ideas?
-
You have to do four things to put a package under version control.
1. Set the unique ID in %APPDATA%\SPARX_Systems\EA\paths.txt
2. Use API VersionControlAdd(..)
3. Set the svn path in registry
HKEY_CURRENT_USER\Software\SPARX Systems\EA400\EA\Options\VC_SVNExePath
4. svn Timeout in registry (VC_TIMEOUT)
I hope it's all.
Helmut
There must be something we missed since it still does not work properly.
Is there another registry entry or database value that keeps data for this purpose?
The registry I've modified is the same as manual-defined configurations and I do not see something different.
Thanks in advance!