简体   繁体   English

自动化企业架构师配置

[英]Automate Enterprise Architect Configuration

We are using Enterprise Architect for our models. 我们正在为模型使用Enterprise Architect

EA can be integrated with version control system, for that, it is required to set configuration from EA to the directory in SVN folder- in which the XMI files of packages will be stored. EA可以与版本控制系统集成,为此,需要将EA配置设置为SVN文件夹中的目录,该目录中将存储软件包的XMI文件。

The configuration settings process is a long and annoying process which we would like to be done automatically. 配置设置过程是一个漫长而烦人的过程,我们希望自动完成该过程。

Is there a way to do this programmatically? 有办法以编程方式执行此操作吗?

UPDATE: This is the window which requires the manual configuration for each machine. 更新:这是需要对每台计算机进行手动配置的窗口。

在此处输入图片说明

Yes, there is. 就在这里。 The API does not support selecting version control provider etc, but it does support adding/removing packages to/from version control and checking them in and out once the provider is set. 该API不支持选择版本控制提供程序等,但是它确实支持在版本控制中添加/从版本控制中删除程序包,以及在设置了提供程序后将其签入和签出。

The methods are in the Package class (in the help file under Automation and Scripting -- Enterprise Architect Object Model -- Reference -- Repository Package -- Package Class): 这些方法在Package类中(在“自动化和脚本”下的帮助文件中-Enterprise Architect对象模型-参考-存储库Package-Package类中):

VersionControlAdd()
VersionControlCheckin()
VersionControlCheckinEx()
VersionControlCheckout()
VersionControlGetLatest()
VersionControlGetStatus()
VersionControlPutLatest()
VersionControlRemove()
VersionControlResynchPkgStatus()

Repository.VersionControlResynchPkgStatuses() resynchronizes all version-controlled packages, but that's the only project-level version control method in the API. Repository.VersionControlResynchPkgStatuses()重新同步所有版本控制的程序包,但这是API中唯一的项目级版本控制方法。

You don't have to write an Add-In if it's a one-off thing. 如果是一次性的,则不必编写外接程序。 A stand-alone application has access to the Object Model API, whereas an Add-In (which is integrated into EA) also has access to the Add-In Model API (see Automation and Scripting -- Enterprise Architect Add-In Model). 独立的应用程序可以访问对象模型API,而外接程序(集成到EA中)也可以访问外接程序模型API(请参阅自动化和脚本编制-Enterprise Architect外接程序模型)。

The Add-In Model API fires a number of events when model elements are created, updated, etc, but no events are triggered by version control changes. 当模型元素被创建,更新等时,外接模型API会触发许多事件,但是版本控制更改不会触发任何事件。 So if you only need to add a number of packages to the version control repository, a stand-alone application can do that. 因此,如果您只需要向版本控制存储库中添加许多软件包,那么独立的应用程序可以做到这一点。

Have you referred to the best practices prescribed by Sparx? 您是否提到了Sparx规定的最佳做法? http://www.sparxsystems.com/WhitePapers/Version_Control.pdf http://www.sparxsystems.com/WhitePapers/Version_Control.pdf

Whilst I agree it could be a time-consuming process to setup version control for the first time, there are several tricks which could make it less cumbersome. 虽然我同意这可能是一个非常耗时的过程,但是第一次使用版本控制时,有一些技巧可以减少它的麻烦。 Eg COnfiguring the packages (or branches) in one model and then sharing the same to the rest of the team, and just letting them specify the Working Copy of the rewpository. 例如,在一个模型中配置包(或分支),然后将其共享给团队的其他成员,然后让他们指定存储库的工作副本。

PS - It is also best not to interfere with the package structure in your SVN folder, and let EA take care of the same PS-最好不要干扰SVN文件夹中的软件包结构,并让EA负责

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM