Book a Demo

Author Topic: ProjectTransfer method - existing target fails  (Read 6501 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
ProjectTransfer method - existing target fails
« on: August 11, 2015, 02:24:51 pm »
In the Project Interface ProjectTransfer method, the Help file says (inter alia):
In automation, the target file does not have to exist; the file path is enough. Enterprise Architect creates a new, empty Base.EAP file and transfers the source project into it.

It seems the Target file MUST NOT EXIST!  If it does, then the transfer fails with the following log message:
Data Transfer Failed due to any of the following reasons
1. Source File is not existing
2. Target File is already existing             <--- This is the culprit
3. Target File is not an EAP File because Target should be an EAP in AI

Given that there is (should be), effectively, NO difference between a real EAP file (which will be emptied before transfer) and an empty EABase.eap file which is created, I don't see why the target file existing is a problem.

Since we are using Office 2013, we can't even OPEN the target file after transfer.  We had to create our own Access 2000 EABase.eap from the Sparx Website in the installation folder - which will get overwritten by the next update - putting us back where we shouldn't be.

Please allow the target file to exist and be overwritten.

Reported,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: ProjectTransfer method - existing target fails
« Reply #1 on: August 11, 2015, 05:03:21 pm »
Paolo,

AFAIK the target .eap file MUST exists or the project transfer fails.
(unless that behavior has changed in the last months)

Geert

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: ProjectTransfer method - existing target fails
« Reply #2 on: August 11, 2015, 05:42:36 pm »
Quote
Paolo,

AFAIK the target .eap file MUST exists or the project transfer fails.
(unless that behavior has changed in the last months)

Geert
THe behaviour under automation appears to be the exact opposite of the behaviour under manual control.  BTW automation is VBScript

Read the first paragraph of the first topic post.  EA will create a target under automation.

FWIW, the same behaviour applies under v9.1 (909).

I'll try at home to see if there's any difference.

Paolo
« Last Edit: August 11, 2015, 05:46:32 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: ProjectTransfer method - existing target fails
« Reply #3 on: August 11, 2015, 05:58:56 pm »
Ah, I didn't notice that you were talking about the API method.

Still weird that it behaves that much differently from the GUI method.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: ProjectTransfer method - existing target fails
« Reply #4 on: August 11, 2015, 06:11:48 pm »
RTFM

Transfers the project from a .EAP file or DBMS to a .EAP file.

Parameters:

· SourceFilePath: String - the path of the source file to transfer

· TargetFilePath: String - the path of the target file; Enterprise Architect creates a new Base project in this location

· LogFilePath: String - the path of the log file where the status of the transfer process is updated
 

 ;D

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: ProjectTransfer method - existing target fails
« Reply #5 on: August 11, 2015, 09:11:33 pm »
Quote
RTFM

Transfers the project from a .EAP file or DBMS to a .EAP file.

Parameters:

· SourceFilePath: String - the path of the source file to transfer

· TargetFilePath: String - the path of the target file; Enterprise Architect creates a new Base project in this location

· LogFilePath: String - the path of the log file where the status of the transfer process is updated
 

 ;D

q.
Trust you to spot it!   ;D

I'll put in a feature request...  I don't see why you shouldn't be able to overwrite an existing file.

@RoyC - you need to fix the documentation to be MORE explicit.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: ProjectTransfer method - existing target fails
« Reply #6 on: August 12, 2015, 09:11:29 am »
The API function was intentionally created to ensure it couldn't be used to override a live repository. That's why there is no allowance for an existing eap file or transferring to a repository.

If the problem is that you want to use a JET 4 repository instead, replace the EABase.eap in the install location with a JET 4 file.
« Last Edit: August 12, 2015, 09:13:02 am by simonm »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: ProjectTransfer method - existing target fails
« Reply #7 on: August 12, 2015, 09:43:29 am »
Quote
The API function was intentionally created to ensure it couldn't be used to override a live repository. That's why there is no allowance for an existing eap file or transferring to a repository.

If the problem is that you want to use a JET 4 repository instead, replace the EABase.eap in the install location with a JET 4 file.
Since you can do that manually (and because I do project transfers A LOT) I've managed to do that more than once.  Thank goodness for good backups.

Since I HAVE to remove the "live" database before I can make a copy - using the current functionality, I don't see the point in stopping me in the API.  All it does is make life difficult for no effective increase in "safety".

I think at least, there should be the option to force overwrite or specify a specific base file.  THe one in the installation folder can be changed by an upgrade.  I'll submit a feature request to that effect.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!