From 11416567bc9516ad2a0cc136020adf2f35830958 Mon Sep 17 00:00:00 2001 From: Tyson Lawrie Date: Fri, 27 Jan 2023 20:06:56 +1100 Subject: [PATCH] Attempt at fixing defect --- .../service/crud/WorkflowScheduleServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/boomerang/service/crud/WorkflowScheduleServiceImpl.java b/src/main/java/io/boomerang/service/crud/WorkflowScheduleServiceImpl.java index d1d659069..42c27c173 100644 --- a/src/main/java/io/boomerang/service/crud/WorkflowScheduleServiceImpl.java +++ b/src/main/java/io/boomerang/service/crud/WorkflowScheduleServiceImpl.java @@ -32,7 +32,7 @@ import io.boomerang.util.ParameterMapper; /* - * Workflow Schedule Serivce provides all the methods for both the Schedules page and the individual Workflow Schedule + * Workflow Schedule Service provides all the methods for both the Schedules page and the individual Workflow Schedule * and abstracts the quartz implementation. * * @since Flow 3.6.0 @@ -203,9 +203,10 @@ public WorkflowSchedule createSchedule(final WorkflowSchedule schedule) { scheduleEntity.setParameters(propertyList); } Boolean enableJob = false; - if (WorkflowScheduleStatus.active.equals(schedule.getStatus()) && wfEntity.getTriggers().getScheduler().getEnable()) { - scheduleEntity.setStatus(WorkflowScheduleStatus.trigger_disabled); + if (WorkflowScheduleStatus.active.equals(scheduleEntity.getStatus()) && wfEntity.getTriggers().getScheduler().getEnable()) { enableJob = true; + } else if (WorkflowScheduleStatus.active.equals(scheduleEntity.getStatus()) && !wfEntity.getTriggers().getScheduler().getEnable()) { + scheduleEntity.setStatus(WorkflowScheduleStatus.trigger_disabled); } workflowScheduleRepository.saveSchedule(scheduleEntity); createOrUpdateSchedule(scheduleEntity, enableJob);