2011-12-08 63 views
1

我们正在为我们的模型使用Enterprise Architect,并使用数据库保存其所有数据。我们现在需要每天“转储”数据,以便我们可以将其存储在我们的配置管理系统中。是否有捷径可寻?自动备份Enterprise Architect数据

回答

2

对此没有特定的内置功能。 EA有几个版本控制选项,但它们是基于软件包而不是整个项目。 (顺便说一句,不建议使用外部版本控制系统与数据库存储的EA项目结合使用,所以除非您完全确定自己在做什么,否则不要启动该路径;请改用EA的基准线)

使用“项目转移”功能(在工具 - 数据管理下)手动转储项目很容易。这使您可以将整个项目从数据库传输到.EAP文件(以及其他三个组合)。该过程通常不到一分钟。

这个函数也可以在EA API(Project :: ProjectTransfer)中使用,所以如果你想自动化它,你可以这样做。在之前的工作中,我设计并实现了一个版本控制解决方案,这是一个组件,因此可以完成,而且甚至不是那么困难。

+0

示例代码似乎有点欠缺这一点。你有任何示例代码,或者可以指向任何有关如何执行它的文档?谢谢! – Firedragon

0

这可能是老了,但记录从海尔特Bellekens

sub main 

Dim CurrentDate 
Currentdate = Replace(Date, "/", "-") 

dim repository 
dim projectInterface 
set repository = CreateObject("EA.Repository") 

Dim FileName 
Filename = "EA_Export.eap" 

dim LogFilePath 
LogFilePath = "C:\EA\EA_to_EAP.log" 

dim TargetFilePath 
TargetFilePath = "C:\EA\EA_Export.eap" 

dim eapString 
eapString = "EAConnectString:DB_EA_PROD --- DBType=1;Connect=Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DB_EA_PROD;Data Source=BESQLCP;LazyLoad=1;" 

'get project interface 
set projectInterface = repository.GetProjectInterface() 

projectInterface.ProjectTransfer eapString, TargetFilePath, LogFilePath 

'repository.CloseFile 
repository.Exit 

Dim newFilename 
newFilename = "C:\EA\EAP_Files\EA_Export_" & CurrentDate & ".eap" 

Dim Fso 
Set Fso = WScript.CreateObject("Scripting.FileSystemObject") 
Fso.MoveFile "C:\EA\EA_Export.eap", newFileName 

end sub 

main 

从引用一个VBScript的一些示例代码:http://sparxsystems.com/forums/smf/index.php/topic,37635.msg235329.html#msg235329