if (currentApplicationVersion != null) {
editing = true;
}
// Check what the current AppState of the applicationVersion is if the version already exists and is being edited.
AppState currentAppState = determineCurrentAppState(currentApplicationVersion);
// Make a copy of the original requested AppState in case the application version is to be resigned.
AppState requestedAppState = applicationVersionForm.getAppState();
Domain parentDomain = parentApplication.getOwnedGroup();
// Only continue if the parent domain exists.
if (parentDomain != null) {