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!
Solved! Go to Solution.
Solved by jackywen. Go to Solution.
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
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!
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!
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
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