// Check if application version was successfully staged to be resigned and if not the the application version in an error state.
if (!resignSuccess) {
// TODO: refactor to send notifications whenever proper audit trail is in place so that admins being notified know why the application version is in the error state.
updateApplicationVersionState(savedApplicationVersion, AppState.ERROR, false);
throw new ApplicationVersionResignException(ResignErrorType.GENERIC);
}
}
// Send notifications only if the application version is newly persisted or it was being edited and the AppState changed
if (sendNotifications && ((currentAppState != null && !currentAppState.equals(savedApplicationVersion.getAppState()))