|
|
|
@ -17,14 +17,28 @@
|
|
|
|
|
|
|
|
|
|
package org.apache.dolphinscheduler.api.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.fasterxml.jackson.databind.JsonNode; |
|
|
|
|
import com.fasterxml.jackson.databind.node.ArrayNode; |
|
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode; |
|
|
|
|
import com.google.common.collect.Lists; |
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_MOVE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.VERSION_DELETE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.VERSION_LIST; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_BATCH_COPY; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_CREATE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_DEFINITION; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_DEFINITION_DELETE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_DEFINITION_EXPORT; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_EXPORT; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_IMPORT; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_ONLINE_OFFLINE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_SWITCH_TO_THIS_VERSION; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_TREE_VIEW; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_UPDATE; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.COPY_SUFFIX; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.DEFAULT_WORKER_GROUP; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.EMPTY_STRING; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.IMPORT_SUFFIX; |
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.COMPLEX_TASK_TYPES; |
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_SQL; |
|
|
|
|
|
|
|
|
|
import org.apache.dolphinscheduler.api.dto.DagDataSchedule; |
|
|
|
|
import org.apache.dolphinscheduler.api.dto.ScheduleParam; |
|
|
|
|
import org.apache.dolphinscheduler.api.dto.treeview.Instance; |
|
|
|
@ -94,16 +108,10 @@ import org.apache.dolphinscheduler.plugin.task.api.parameters.ParametersNode;
|
|
|
|
|
import org.apache.dolphinscheduler.plugin.task.api.parameters.SqlParameters; |
|
|
|
|
import org.apache.dolphinscheduler.service.process.ProcessService; |
|
|
|
|
import org.apache.dolphinscheduler.service.task.TaskPluginManager; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.http.MediaType; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
|
|
|
|
import java.io.BufferedOutputStream; |
|
|
|
|
import java.io.BufferedReader; |
|
|
|
|
import java.io.IOException; |
|
|
|
@ -127,27 +135,6 @@ import java.util.stream.Collectors;
|
|
|
|
|
import java.util.zip.ZipEntry; |
|
|
|
|
import java.util.zip.ZipInputStream; |
|
|
|
|
|
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.TASK_DEFINITION_MOVE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.VERSION_DELETE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.VERSION_LIST; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_BATCH_COPY; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_CREATE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_DEFINITION; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_DEFINITION_DELETE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_DEFINITION_EXPORT; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_EXPORT; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_IMPORT; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_ONLINE_OFFLINE; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_SWITCH_TO_THIS_VERSION; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_TREE_VIEW; |
|
|
|
|
import static org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant.WORKFLOW_UPDATE; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.CMD_PARAM_SUB_PROCESS_DEFINE_CODE; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.COPY_SUFFIX; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.DEFAULT_WORKER_GROUP; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.EMPTY_STRING; |
|
|
|
|
import static org.apache.dolphinscheduler.common.Constants.IMPORT_SUFFIX; |
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.COMPLEX_TASK_TYPES; |
|
|
|
|
import static org.apache.dolphinscheduler.plugin.task.api.TaskConstants.TASK_TYPE_SQL; |
|
|
|
|
import javax.servlet.ServletOutputStream; |
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
|
@ -273,44 +260,25 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
|
|
|
|
|
if (result.get(Constants.STATUS) != Status.SUCCESS) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
if(checkDescriptionLength(description)){ |
|
|
|
|
putMsg(result, Status.DESCRIPTION_TOO_LONG_ERROR); |
|
|
|
|
return result; |
|
|
|
|
if (checkDescriptionLength(description)) { |
|
|
|
|
throw new ServiceException(Status.DESCRIPTION_TOO_LONG_ERROR); |
|
|
|
|
} |
|
|
|
|
// check whether the new process define name exist
|
|
|
|
|
ProcessDefinition definition = processDefinitionMapper.verifyByDefineName(project.getCode(), name); |
|
|
|
|
if (definition != null) { |
|
|
|
|
putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
List<TaskDefinitionLog> taskDefinitionLogs = JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class); |
|
|
|
|
Map<String, Object> checkTaskDefinitions = checkTaskDefinitionList(taskDefinitionLogs, taskDefinitionJson); |
|
|
|
|
if (checkTaskDefinitions.get(Constants.STATUS) != Status.SUCCESS) { |
|
|
|
|
return checkTaskDefinitions; |
|
|
|
|
} |
|
|
|
|
List<ProcessTaskRelationLog> taskRelationList = |
|
|
|
|
JSONUtils.toList(taskRelationJson, ProcessTaskRelationLog.class); |
|
|
|
|
Map<String, Object> checkRelationJson = |
|
|
|
|
checkTaskRelationList(taskRelationList, taskRelationJson, taskDefinitionLogs); |
|
|
|
|
if (checkRelationJson.get(Constants.STATUS) != Status.SUCCESS) { |
|
|
|
|
return checkRelationJson; |
|
|
|
|
throw new ServiceException(Status.PROCESS_DEFINITION_NAME_EXIST, name); |
|
|
|
|
} |
|
|
|
|
List<TaskDefinitionLog> taskDefinitionLogs = generateTaskDefinitionList(taskDefinitionJson); |
|
|
|
|
List<ProcessTaskRelationLog> taskRelationList = generateTaskRelationList(taskRelationJson, taskDefinitionLogs); |
|
|
|
|
int tenantId = -1; |
|
|
|
|
if (!Constants.DEFAULT.equals(tenantCode)) { |
|
|
|
|
Tenant tenant = tenantMapper.queryByTenantCode(tenantCode); |
|
|
|
|
if (tenant == null) { |
|
|
|
|
putMsg(result, Status.TENANT_NOT_EXIST); |
|
|
|
|
return result; |
|
|
|
|
throw new ServiceException(Status.TENANT_NOT_EXIST); |
|
|
|
|
} |
|
|
|
|
tenantId = tenant.getId(); |
|
|
|
|
} |
|
|
|
|
long processDefinitionCode; |
|
|
|
|
try { |
|
|
|
|
processDefinitionCode = CodeGenerateUtils.getInstance().genCode(); |
|
|
|
|
} catch (CodeGenerateException e) { |
|
|
|
|
putMsg(result, Status.INTERNAL_SERVER_ERROR_ARGS); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
long processDefinitionCode = CodeGenerateUtils.getInstance().genCode(); |
|
|
|
|
ProcessDefinition processDefinition = |
|
|
|
|
new ProcessDefinition(projectCode, name, processDefinitionCode, description, |
|
|
|
|
globalParams, locations, timeout, loginUser.getId(), tenantId); |
|
|
|
@ -330,66 +298,63 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
|
|
|
|
|
logger.info("The task has not changed, so skip"); |
|
|
|
|
} |
|
|
|
|
if (saveTaskResult == Constants.DEFINITION_FAILURE) { |
|
|
|
|
putMsg(result, Status.CREATE_TASK_DEFINITION_ERROR); |
|
|
|
|
throw new ServiceException(Status.CREATE_TASK_DEFINITION_ERROR); |
|
|
|
|
} |
|
|
|
|
int insertVersion = processService.saveProcessDefine(loginUser, processDefinition, Boolean.TRUE, Boolean.TRUE); |
|
|
|
|
if (insertVersion == 0) { |
|
|
|
|
putMsg(result, Status.CREATE_PROCESS_DEFINITION_ERROR); |
|
|
|
|
throw new ServiceException(Status.CREATE_PROCESS_DEFINITION_ERROR); |
|
|
|
|
} |
|
|
|
|
int insertResult = processService.saveTaskRelation(loginUser, processDefinition.getProjectCode(), |
|
|
|
|
processDefinition.getCode(), |
|
|
|
|
insertVersion, taskRelationList, taskDefinitionLogs, Boolean.TRUE); |
|
|
|
|
if (insertResult == Constants.EXIT_CODE_SUCCESS) { |
|
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
|
result.put(Constants.DATA_LIST, processDefinition); |
|
|
|
|
} else { |
|
|
|
|
putMsg(result, Status.CREATE_PROCESS_TASK_RELATION_ERROR); |
|
|
|
|
if (insertResult != Constants.EXIT_CODE_SUCCESS) { |
|
|
|
|
throw new ServiceException(Status.CREATE_PROCESS_TASK_RELATION_ERROR); |
|
|
|
|
} |
|
|
|
|
saveOtherRelation(loginUser, processDefinition, result, otherParamsJson); |
|
|
|
|
|
|
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
|
result.put(Constants.DATA_LIST, processDefinition); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Map<String, Object> checkTaskDefinitionList(List<TaskDefinitionLog> taskDefinitionLogs, |
|
|
|
|
String taskDefinitionJson) { |
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
private List<TaskDefinitionLog> generateTaskDefinitionList(String taskDefinitionJson) { |
|
|
|
|
try { |
|
|
|
|
if (taskDefinitionLogs.isEmpty()) { |
|
|
|
|
logger.error("taskDefinitionJson invalid: {}", taskDefinitionJson); |
|
|
|
|
putMsg(result, Status.DATA_IS_NOT_VALID, taskDefinitionJson); |
|
|
|
|
return result; |
|
|
|
|
List<TaskDefinitionLog> taskDefinitionLogs = JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class); |
|
|
|
|
if (CollectionUtils.isEmpty(taskDefinitionLogs)) { |
|
|
|
|
logger.error("Generate task definition list failed, the given taskDefinitionJson is invalided: {}", |
|
|
|
|
taskDefinitionJson); |
|
|
|
|
throw new ServiceException(Status.DATA_IS_NOT_VALID, taskDefinitionJson); |
|
|
|
|
} |
|
|
|
|
for (TaskDefinitionLog taskDefinitionLog : taskDefinitionLogs) { |
|
|
|
|
|
|
|
|
|
if (!taskPluginManager.checkTaskParameters(ParametersNode.builder() |
|
|
|
|
.taskType(taskDefinitionLog.getTaskType()) |
|
|
|
|
.taskParams(taskDefinitionLog.getTaskParams()) |
|
|
|
|
.dependence(taskDefinitionLog.getDependence()) |
|
|
|
|
.build())) { |
|
|
|
|
logger.error("task definition {} parameter invalid", taskDefinitionLog.getName()); |
|
|
|
|
putMsg(result, Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionLog.getName()); |
|
|
|
|
return result; |
|
|
|
|
logger.error( |
|
|
|
|
"Generate task definition list failed, the given task definition parameter is invalided, taskName: {}, taskDefinition: {}", |
|
|
|
|
taskDefinitionLog.getName(), taskDefinitionLog); |
|
|
|
|
throw new ServiceException(Status.PROCESS_NODE_S_PARAMETER_INVALID, taskDefinitionLog.getName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
|
return taskDefinitionLogs; |
|
|
|
|
} catch (ServiceException ex) { |
|
|
|
|
throw ex; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
result.put(Constants.STATUS, Status.REQUEST_PARAMS_NOT_VALID_ERROR); |
|
|
|
|
result.put(Constants.MSG, e.getMessage()); |
|
|
|
|
logger.error("Generate task definition list failed, meet an unknown exception", e); |
|
|
|
|
throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR); |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Map<String, Object> checkTaskRelationList(List<ProcessTaskRelationLog> taskRelationList, |
|
|
|
|
String taskRelationJson, |
|
|
|
|
List<TaskDefinitionLog> taskDefinitionLogs) { |
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
|
|
private List<ProcessTaskRelationLog> generateTaskRelationList(String taskRelationJson, |
|
|
|
|
List<TaskDefinitionLog> taskDefinitionLogs) { |
|
|
|
|
try { |
|
|
|
|
if (taskRelationList == null || taskRelationList.isEmpty()) { |
|
|
|
|
logger.error("task relation list is null"); |
|
|
|
|
putMsg(result, Status.DATA_IS_NOT_VALID, taskRelationJson); |
|
|
|
|
return result; |
|
|
|
|
List<ProcessTaskRelationLog> taskRelationList = |
|
|
|
|
JSONUtils.toList(taskRelationJson, ProcessTaskRelationLog.class); |
|
|
|
|
if (CollectionUtils.isEmpty(taskRelationList)) { |
|
|
|
|
logger.error("Generate task relation list failed the taskRelation list is empty, taskRelationJson: {}", |
|
|
|
|
taskRelationJson); |
|
|
|
|
throw new ServiceException(Status.DATA_IS_NOT_VALID); |
|
|
|
|
} |
|
|
|
|
List<ProcessTaskRelation> processTaskRelations = taskRelationList.stream() |
|
|
|
|
.map(processTaskRelationLog -> JSONUtils.parseObject(JSONUtils.toJsonString(processTaskRelationLog), |
|
|
|
@ -403,31 +368,29 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
|
|
|
|
|
Collection<Long> codes = CollectionUtils.subtract(postTaskCodes, taskNodeCodes); |
|
|
|
|
if (CollectionUtils.isNotEmpty(codes)) { |
|
|
|
|
logger.error("the task code is not exist"); |
|
|
|
|
putMsg(result, Status.TASK_DEFINE_NOT_EXIST, |
|
|
|
|
StringUtils.join(codes, Constants.COMMA)); |
|
|
|
|
return result; |
|
|
|
|
throw new ServiceException(Status.TASK_DEFINE_NOT_EXIST, StringUtils.join(codes, Constants.COMMA)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (graphHasCycle(taskNodeList)) { |
|
|
|
|
logger.error("process DAG has cycle"); |
|
|
|
|
putMsg(result, Status.PROCESS_NODE_HAS_CYCLE); |
|
|
|
|
return result; |
|
|
|
|
throw new ServiceException(Status.PROCESS_NODE_HAS_CYCLE); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// check whether the task relation json is normal
|
|
|
|
|
for (ProcessTaskRelationLog processTaskRelationLog : taskRelationList) { |
|
|
|
|
if (processTaskRelationLog.getPostTaskCode() == 0) { |
|
|
|
|
logger.error("the post_task_code or post_task_version can't be zero"); |
|
|
|
|
putMsg(result, Status.CHECK_PROCESS_TASK_RELATION_ERROR); |
|
|
|
|
return result; |
|
|
|
|
throw new ServiceException(Status.CHECK_PROCESS_TASK_RELATION_ERROR); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
|
return taskRelationList; |
|
|
|
|
} catch (ServiceException ex) { |
|
|
|
|
throw ex; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
result.put(Constants.STATUS, Status.REQUEST_PARAMS_NOT_VALID_ERROR); |
|
|
|
|
result.put(Constants.MSG, e.getMessage()); |
|
|
|
|
logger.error("Check task relation list error, meet an unknown exception, given taskRelationJson: {}", |
|
|
|
|
taskRelationJson, e); |
|
|
|
|
throw new ServiceException(Status.REQUEST_PARAMS_NOT_VALID_ERROR); |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -629,22 +592,12 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
|
|
|
|
|
if (result.get(Constants.STATUS) != Status.SUCCESS) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
if(checkDescriptionLength(description)){ |
|
|
|
|
if (checkDescriptionLength(description)) { |
|
|
|
|
putMsg(result, Status.DESCRIPTION_TOO_LONG_ERROR); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
List<TaskDefinitionLog> taskDefinitionLogs = JSONUtils.toList(taskDefinitionJson, TaskDefinitionLog.class); |
|
|
|
|
Map<String, Object> checkTaskDefinitions = checkTaskDefinitionList(taskDefinitionLogs, taskDefinitionJson); |
|
|
|
|
if (checkTaskDefinitions.get(Constants.STATUS) != Status.SUCCESS) { |
|
|
|
|
return checkTaskDefinitions; |
|
|
|
|
} |
|
|
|
|
List<ProcessTaskRelationLog> taskRelationList = |
|
|
|
|
JSONUtils.toList(taskRelationJson, ProcessTaskRelationLog.class); |
|
|
|
|
Map<String, Object> checkRelationJson = |
|
|
|
|
checkTaskRelationList(taskRelationList, taskRelationJson, taskDefinitionLogs); |
|
|
|
|
if (checkRelationJson.get(Constants.STATUS) != Status.SUCCESS) { |
|
|
|
|
return checkRelationJson; |
|
|
|
|
} |
|
|
|
|
List<TaskDefinitionLog> taskDefinitionLogs = generateTaskDefinitionList(taskDefinitionJson); |
|
|
|
|
List<ProcessTaskRelationLog> taskRelationList = generateTaskRelationList(taskRelationJson, taskDefinitionLogs); |
|
|
|
|
|
|
|
|
|
int tenantId = -1; |
|
|
|
|
if (!Constants.DEFAULT.equals(tenantCode)) { |
|
|
|
@ -786,7 +739,8 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
|
|
|
|
|
* @return true if process definition name not exists, otherwise false |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Map<String, Object> verifyProcessDefinitionName(User loginUser, long projectCode, String name, long processDefinitionCode) { |
|
|
|
|
public Map<String, Object> verifyProcessDefinitionName(User loginUser, long projectCode, String name, |
|
|
|
|
long processDefinitionCode) { |
|
|
|
|
Project project = projectMapper.queryByCode(projectCode); |
|
|
|
|
// check user access for project
|
|
|
|
|
Map<String, Object> result = |
|
|
|
@ -2228,7 +2182,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
|
|
|
|
|
if (result.get(Constants.STATUS) != Status.SUCCESS) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
if(checkDescriptionLength(description)){ |
|
|
|
|
if (checkDescriptionLength(description)) { |
|
|
|
|
putMsg(result, Status.DESCRIPTION_TOO_LONG_ERROR); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
@ -2367,7 +2321,7 @@ public class ProcessDefinitionServiceImpl extends BaseServiceImpl implements Pro
|
|
|
|
|
if (result.get(Constants.STATUS) != Status.SUCCESS) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
if(checkDescriptionLength(description)){ |
|
|
|
|
if (checkDescriptionLength(description)) { |
|
|
|
|
putMsg(result, Status.DESCRIPTION_TOO_LONG_ERROR); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|