Skip to content

Commit

Permalink
add check start time when set schedule online
Browse files Browse the repository at this point in the history
  • Loading branch information
Radeity committed Dec 12, 2022
1 parent 0c599c6 commit 6f09c37
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,13 @@ public Map<String, Object> setScheduleState(User loginUser,
return result;
}
if (scheduleStatus == ReleaseState.ONLINE) {
// check schedule start time
Date now = new Date();
if (now.after(scheduleObj.getStartTime())) {
logger.warn("The start time must be later than current time.");
putMsg(result, Status.START_TIME_BEFORE_CURRENT_TIME_ERROR);
return result;
}
// check process definition release state
if (processDefinition.getReleaseState() != ReleaseState.ONLINE) {
logger.warn("Only process definition state is {} can change schedule state, processDefinitionCode:{}.",
Expand Down

0 comments on commit 6f09c37

Please sign in to comment.