When creating Active Objects upgrade tasks, there is a ModelVersion parameter accessible in the upgrade() method:
public void upgrade(ModelVersion currentVersion, ActiveObjects ao) {
...
}
Is it useful in any real-world scenario? I checked several source code samples but none of them is using that.
See examples here: https://bitbucket.org/marioct/jira-bitbucket-connector/src/2cc7568b09d312c4b985d8c9563868295d753092/jira-dvcs-connector-plugin/src/main/java/com/atlassian/jira/plugins/dvcs/activeobjects/v3/?at=default
JavaDoc: https://developer.atlassian.com/static/javadoc/activeobjects/0.17.2/reference/com/atlassian/activeobjects/external/ActiveObjectsUpgradeTask.html#upgrade(com.atlassian.activeobjects.external.ModelVersion, com.atlassian.activeobjects.external.ActiveObjects)
Community moderators have prevented the ability to post new answers.
I have not used it myself (apart from logging), but I guess it could be used to know which version the existing data has, and to use that information to decide how it should be upgraded.
Yep, trivially yes, but that sounds redundant.
Here is why we feel that way: if you initially have model "1", then "2", then "3". You have to have two separate upgrade tasks in this case, one "1"->"2" and one "2"->"3". Now, let's say now you're upgrading to "3". If you are on "1", it is the ActiveObject framework that guarantees that both task will be invoked and they will be called in the guaranteed order. So, the parameter is useless for this use case, too.
So, it wouldn't explain the need for that param.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.