Book a Demo

Author Topic: Project Transfer Automation  (Read 6264 times)

[email protected]

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Project Transfer Automation
« on: December 15, 2016, 07:04:48 pm »
Hello,

we manage our EA Models in SQL Database and transfer thw different models every day to eap file. Is there away to do the project transfer via batch/skript to automate the database transfer into eap file?

Thanks a lot for some ideas.

best regards

Anton

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Project Transfer Automation
« Reply #1 on: December 15, 2016, 08:33:10 pm »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Project Transfer Automation
« Reply #2 on: December 15, 2016, 08:39:21 pm »
You can run a vbs script as a scheduled task
 
A client of mine uses the following code in  vbs file:
Just make sure you run the taks with an actual user logged in.

Code: [Select]
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