@SuppressWarnings("unused") public static boolean isCampaignClosed(AccessCertificationCampaignType campaign) { int currentStage = campaign.getStageNumber(); int stages = getNumberOfStages(campaign); return CLOSED.equals(campaign.getState()) || currentStage > stages; }
final AccessCertificationCampaignStateType state = campaign.getState(); LOGGER.trace("openNextStage: iteration={}, currentStageNumber={}, stages={}, state={}", norm(campaign.getIteration()), currentStageNumber, stages, state); if (IN_REVIEW_STAGE.equals(state)) { result.recordFatalError("Couldn't advance to the next review stage as the stage " + currentStageNumber + " is currently open."); } else if (IN_REMEDIATION.equals(state)) { result.recordFatalError("Couldn't advance to the next review stage as the campaign is currently in the remediation phase."); } else if (CLOSED.equals(state)) { result.recordFatalError("Couldn't advance to the next review stage as the campaign is already closed."); } else if (!REVIEW_STAGE_DONE.equals(state) && !CREATED.equals(state)) { throw new IllegalStateException("Unexpected campaign state: " + state); } else if (currentStageNumber >= stages) {
LOGGER.trace("closeCurrentStage: currentStageNumber={}, stages={}, state={}", currentStageNumber, stages, state); if (!IN_REVIEW_STAGE.equals(state)) { result.recordFatalError("Couldn't close the current review stage as it is currently not open"); } else {
} else if (!REVIEW_STAGE_DONE.equals(state)) { result.recordFatalError("Couldn't start the remediation as the last stage was not properly closed."); } else {