- String errorMsg = " is not defined in property file. Please check the property file and make sure all the schedule constant values are defined";
- HashMap<String, String> constantMap = new HashMap<>();
- constantMap.put(SchedulerProperties.SCHEDULER_DOMAIN_NAME, "domainName");
- constantMap.put(SchedulerProperties.SCHEDULER_SCHEDULE_NAME, "scheduleName");
- constantMap.put(SchedulerProperties.SCHEDULER_WORKFLOW_NAME, "workflowName");
- constantMap.put(SchedulerProperties.SCHEDULER_CALLBACK_URL, "callbackUrl");
- constantMap.put(SchedulerProperties.SCHEDULER_APPROVAL_TYPE, "approvalType");
- constantMap.put(SchedulerProperties.SCHEDULER_APPROVAL_SUBMIT_STATUS, "approvalSubmitStatus");
- constantMap.put(SchedulerProperties.SCHEDULER_APPROVAL_REJECT_STATUS, "approvalRejectStatus");
- constantMap.put(SchedulerProperties.SCHEDULER_POLICY_NAME, "policyName");
- constantMap.put(SchedulerProperties.SCHEDULER_INTERVAL_GET_TIMESLOT_RATE, "intervalRate");
- constantMap.put(SchedulerProperties.SCHEDULER_GROUP_ID, "groupId");
- try {
- Map<String, String> map = new HashMap<>();
- for (Map.Entry<String, String> entry : constantMap.entrySet()) {
- if (SchedulerProperties.containsProperty(entry.getKey()))
- map.put(entry.getValue(), SchedulerProperties.getProperty(entry.getKey()));
- else
- throw new Exception(entry.getKey() + errorMsg);
- }
- logger.debug(EELFLoggerDelegate.debugLogger, " portalRestResponse - getSchedulerConstant= {}",
+
+ if (checkIfUserISValidToMakeSchedule(request)) {
+ String errorMsg = " is not defined in property file. Please check the property file and make sure all the schedule constant values are defined";
+ HashMap<String, String> constantMap = new HashMap<>();
+ constantMap.put(SchedulerProperties.SCHEDULER_DOMAIN_NAME, "domainName");
+ constantMap.put(SchedulerProperties.SCHEDULER_SCHEDULE_NAME, "scheduleName");
+ constantMap.put(SchedulerProperties.SCHEDULER_WORKFLOW_NAME, "workflowName");
+ constantMap.put(SchedulerProperties.SCHEDULER_CALLBACK_URL, "callbackUrl");
+ constantMap.put(SchedulerProperties.SCHEDULER_APPROVAL_TYPE, "approvalType");
+ constantMap.put(SchedulerProperties.SCHEDULER_APPROVAL_SUBMIT_STATUS, "approvalSubmitStatus");
+ constantMap.put(SchedulerProperties.SCHEDULER_APPROVAL_REJECT_STATUS, "approvalRejectStatus");
+ constantMap.put(SchedulerProperties.SCHEDULER_POLICY_NAME, "policyName");
+ constantMap.put(SchedulerProperties.SCHEDULER_INTERVAL_GET_TIMESLOT_RATE, "intervalRate");
+ constantMap.put(SchedulerProperties.SCHEDULER_GROUP_ID, "groupId");
+ try {
+ Map<String, String> map = new HashMap<>();
+ for (Map.Entry<String, String> entry : constantMap.entrySet()) {
+ if (SchedulerProperties.containsProperty(entry.getKey()))
+ map.put(entry.getValue(), SchedulerProperties.getProperty(entry.getKey()));
+ else
+ throw new Exception(entry.getKey() + errorMsg);
+ }
+ logger.debug(EELFLoggerDelegate.debugLogger, " portalRestResponse - getSchedulerConstant= {}", map);
+ portalRestResponse = new PortalRestResponse<>(PortalRestStatusEnum.OK, "success",