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: 

Revise using API

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
simonsson
1987 Views, 6 Replies

Revise using API

When changing category of a file in Vault Workgroup the state and revision (scheme) is not immediately changed. You have to do this manually. I'm trying to do the revision update using the API. The method UpdateFileRevisionNumbers solves the problem if I know exactly what will be the next revision. What is the best way to revise (set next revision) of a file using API.

 

mDocSvcExt.UpdateFileRevisionNumbers(fileIds, NO_CLUE, "Testing testing...");

 

I want to use the primary revision sequense.

 

Thanks!

 

6 REPLIES 6
Message 2 of 7
Pingyong.Zhang
in reply to: simonsson

The method GetNextRevisionNumbersByMasterIds of RevisionService can get an array of available next revisions, including primary, secondary and tertiary revision sequense. And then you can call UpdateFileRevisionNumbers method to revise the file with the next revision achieved from the former method.

 

Hope this helps.

 

Yuki

Message 3 of 7
simonsson
in reply to: Pingyong.Zhang

Thanks! That works good, but it still gives me the next revision of the wrong (old) revision sequense. I guess I'm looking for a way to update to the correct revision scheme for the new file category. Let's say I have categories A and B with revisions A1, A2, A3,... and B1, B2, B3,.... I change a file (with revision number A2) from category A to B and next revision is still A3. I would expect the revision number to be B something.

 

Thanks!

 

Message 4 of 7
simonsson
in reply to: simonsson

I guess I want to set the correct (new) Revision Definition for a file that was changed from one category to another. Manually I can do this by clicking Revise, and then the browse button "...", then ok and then I select "primary" from the dropdown. If I would skip the browse-->ok clicks I would still be in the wrong (old) Revision Definition.

 

Thanks!

 

Message 5 of 7
Pingyong.Zhang
in reply to: simonsson

You should call the method GetNextRevisionNumbersByMasterIds of RevisionService with the new revision scheme id to get the next revision. In your described case, it is revision scheme id of B. If you don't know the new revision scheme id, you find it from revision schemes achieved from the method GetAllRevisionDefinitionInfo. And then you call the method UpdateRevisionDefinitionAndNumbers (not UpdateFileRevisionNumbers) to change revision with the next revision and the new revision scheme id.

 

Hope this helps.

 

Yuki

Message 6 of 7
jackywen
in reply to: simonsson

There is a way you can try: call the API GetCategoryConfigurationById in the CategoryService by passing the category id and behavior class names you concern such as RevisionScheme or LifeCycle. Based on the returned result, you can find out the default revision definition assigned to the category. With the revision definition id, you can call the API GetRevisionDefinitionInfoByIds in the RevisionService to get the revision configuration info based on which you can find out the initial primary revision sequence of the revision definition. Then call the API UpdateRevisionDefinitionAndNumbers in DocumentServiceExtensions to approach you purpose.

 

Regards,

Jacky

Message 7 of 7
simonsson
in reply to: simonsson

That solved my problem! Thanks alot guys! 🙂

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

Post to forums  

Autodesk Design & Make Report