|
|
@ -23,6 +23,7 @@ import org.apache.dolphinscheduler.api.dto.DagDataSchedule; |
|
|
|
import org.apache.dolphinscheduler.api.dto.treeview.Instance; |
|
|
|
import org.apache.dolphinscheduler.api.dto.treeview.Instance; |
|
|
|
import org.apache.dolphinscheduler.api.dto.treeview.TreeViewDto; |
|
|
|
import org.apache.dolphinscheduler.api.dto.treeview.TreeViewDto; |
|
|
|
import org.apache.dolphinscheduler.api.enums.Status; |
|
|
|
import org.apache.dolphinscheduler.api.enums.Status; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.api.exceptions.ServiceException; |
|
|
|
import org.apache.dolphinscheduler.api.service.ProcessDefinitionService; |
|
|
|
import org.apache.dolphinscheduler.api.service.ProcessDefinitionService; |
|
|
|
import org.apache.dolphinscheduler.api.service.ProcessInstanceService; |
|
|
|
import org.apache.dolphinscheduler.api.service.ProcessInstanceService; |
|
|
|
import org.apache.dolphinscheduler.api.service.ProjectService; |
|
|
|
import org.apache.dolphinscheduler.api.service.ProjectService; |
|
|
@ -59,6 +60,7 @@ import org.apache.dolphinscheduler.dao.entity.Tenant; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.User; |
|
|
|
import org.apache.dolphinscheduler.dao.entity.User; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionLogMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionLogMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper; |
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationLogMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProcessTaskRelationMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ScheduleMapper; |
|
|
|
import org.apache.dolphinscheduler.dao.mapper.ScheduleMapper; |
|
|
@ -143,6 +145,9 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private ProcessTaskRelationMapper processTaskRelationMapper; |
|
|
|
private ProcessTaskRelationMapper processTaskRelationMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private ProcessTaskRelationLogMapper processTaskRelationLogMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
TaskDefinitionLogMapper taskDefinitionLogMapper; |
|
|
|
TaskDefinitionLogMapper taskDefinitionLogMapper; |
|
|
|
|
|
|
|
|
|
|
@ -1422,6 +1427,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
* @return delele result code |
|
|
|
* @return delele result code |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
|
|
|
|
@Transactional(rollbackFor = RuntimeException.class) |
|
|
|
public Map<String, Object> deleteProcessDefinitionVersion(User loginUser, long projectCode, long code, int version) { |
|
|
|
public Map<String, Object> deleteProcessDefinitionVersion(User loginUser, long projectCode, long code, int version) { |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
//check user access for project
|
|
|
|
//check user access for project
|
|
|
@ -1434,7 +1440,12 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro |
|
|
|
if (processDefinition == null) { |
|
|
|
if (processDefinition == null) { |
|
|
|
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, code); |
|
|
|
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, code); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
processDefinitionLogMapper.deleteByProcessDefinitionCodeAndVersion(code, version); |
|
|
|
int deleteLog = processDefinitionLogMapper.deleteByProcessDefinitionCodeAndVersion(code, version); |
|
|
|
|
|
|
|
int deleteRelationLog = processTaskRelationLogMapper.deleteByCode(processDefinition.getCode(), processDefinition.getVersion()); |
|
|
|
|
|
|
|
if ((deleteLog & deleteRelationLog) == 0) { |
|
|
|
|
|
|
|
putMsg(result, Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR); |
|
|
|
|
|
|
|
throw new ServiceException(Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR); |
|
|
|
|
|
|
|
} |
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|