Community
Vault Forum
Welcome to Autodesk’s Vault Forums. Share your knowledge, ask questions, and explore popular Vault topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vault API - Add new version of file and revise

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
1978 Views, 3 Replies

Vault API - Add new version of file and revise

Hello,

 

I am migrating documents from an old Vault-like application into Vault.

I have various files representing the versions of a certain document, let's call it TEST.dwg, where the revised versions are 0.2, A.2 and B. So, I have three TEST.dwg files, seperated in folders like: 0.2\TEST.dwg; A.2\TEST.dwg; B\TEST.dwg.

The Vault is already configured to accept this numbering scheme.

 

In Vault, I have created the folders and added the TEST.dwg file successfully (from version 0.2), using the AddFile function.

Naturally, everytime I try to add another version I get the Server Error 1008 indicating the file already exists.

But, things become tricky now that I want to add the other files, corresponding to the other versions.

In the end, I need to be in a state where the document needs the three revisions, corresponding to those three versions of the file.

 

Made some research in the API SDK documentation but found nothing indicating adding a file as a new version or revision (it'd be quicker if I could set as revised right after adding).

I have thought the following solution:

- Checkout to Workspace;

- Copy and replace the new .dwg;

- Check in again.

Don't know if this is also possible through the API.

 

But, I was looking for a more direct solution, since I need to migrate 40k documents or so.

 

Thank you in advance.

Tags (1)
3 REPLIES 3
Message 2 of 4
Redmond.D
in reply to: Anonymous

Upload and "set revision" are separate operations, you can't do them both at once.  The API function for setting the revision is DocumentServiceExtensions.UpdateFileLifeCycleDefinitions( ).

As for uploading new file versions, the workflow you described should work fine.  You always have to check out first before uploading a new version.  You can skip the copy step if you want since the CheckinFile function lets you upload from anywhere on disk.

 

Lastly, we have a discussion group specifically for Vault API questions:  http://forums.autodesk.com/t5/vault-customization/bd-p/301

So that's the ideal place to go next time you have questions like this.

 



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 4
Anonymous
in reply to: Redmond.D

Thank you, that worked perfecly.
And sorry for posting in the wrong section, Vault Customization seemed as Vault Explorer customization only.
Message 4 of 4
m.den.ouden
in reply to: Anonymous

You can alse delete the file(s) first from vault then add again and then change the revision. 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report