How to increment only minor version after Document.RestoreVersion
Hello. After invoke operation Document.RestoreVersion e.g. major version 2 -> major version 1, i need to update document with major version 1 and increment minor version of major version 1, but nuxeo java client return major version 2 after update major version 1. How can i fix this?
Hello, if you are using Java Client, did you try to update the version of the document by using the following?
document = nuxeoClient.operation("Document.CreateVersion").param("increment", "MINOR").input(document).execute();
In this case, with “MINOR”, the version 1.0 will generate the version 1.1. You can also change “MINOR” to “MAYOR” in order to increment from 1.0 to 2.0.
Info about the Document.CreateVersion operation: http://explorer.nuxeo.com/nuxeo/site/distribution/Nuxeo%20DM-8.2/viewOperation/Document.CreateVersion
Hope it helps!
For example, i restored document version 2.4 to version 1.1
document = client.operation("Document.RestoreVersion").input(versionDocument).execute();
Then i need to update this document and increment minor version of current major version (1)
document = client.operation("Document.CreateVersion").input(document).param("increment", "MINOR").param("saveDocument", true).execute();
I expect that document have version 1.2 after this update but version of the document 2.5.