2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
20 package org.openecomp.portalsdk.workflow.services;
22 import java.util.List;
24 import org.openecomp.portalsdk.workflow.dao.WorkflowDAO;
25 import org.openecomp.portalsdk.workflow.domain.WorkflowSchedule;
26 import org.openecomp.portalsdk.workflow.models.Workflow;
27 import org.openecomp.portalsdk.workflow.models.WorkflowLite;
28 import org.springframework.beans.factory.annotation.Autowired;
29 import org.springframework.stereotype.Service;
32 @Service("workflowService")
33 public class WorkflowServiceImpl implements WorkflowService {
36 private WorkflowDAO workflowDAO;
39 //private DataAccessService dataAccessService;
42 private WorkflowScheduleService workflowScheduleService;
45 public void saveCronJob(WorkflowSchedule domainCronJobData) {
46 // TODO Auto-generated method stub
47 workflowScheduleService.saveWorkflowSchedule(domainCronJobData);
48 /* triggerWorkflowScheduling((SchedulerFactoryBean)appContext.getBean(SchedulerFactoryBean.class),domainCronJobData);
52 private DataAccessService getDataAccessService() {
53 // TODO Auto-generated method stub
54 return dataAccessService;
59 public Workflow addWorkflow(Workflow workflow, String creatorId) {
60 return workflowDAO.save(workflow, creatorId);
64 public Workflow editWorkflow(WorkflowLite workflow, String creatorId) {
65 return workflowDAO.edit(workflow, creatorId);
69 public void deleteWorkflow(Long workflowId) {
70 workflowDAO.delete(workflowId);
74 public List<Workflow> getAllWorkflows() {
75 return workflowDAO.getWorkflows();