Document previous = null;
// Set of version number
- if (state == ProgressState.EXTERN) {
- if (aDoc.getProgressState() != ProgressState.EXTERN) {
- aDoc.setVersion(null); // Strange use-case...
- }
- } else {
Revision myvers = new Revision(aDoc.getVersion());
if (!myvers.isNull()) { // Versionning context
previous = aDoc.getPreviousVersion();
myvers.incrementAs(state); // Incrementation if the reversion number is not imposed
}
aDoc.setVersion(myvers.toString());
- }
+
// Update this document and the previous version, if exist
if (previous != null) {
previous.setHistory(previous.getHistory() + 1);