|
@@ -17,24 +17,6 @@
|
|
|
|
|
|
package org.apache.dolphinscheduler.api.controller;
|
|
|
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.BATCH_COPY_PROCESS_DEFINITION_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.BATCH_DELETE_PROCESS_DEFINE_BY_CODES_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.BATCH_MOVE_PROCESS_DEFINITION_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.CREATE_PROCESS_DEFINITION_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.DELETE_PROCESS_DEFINE_BY_CODE_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.DELETE_PROCESS_DEFINITION_VERSION_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.ENCAPSULATION_TREEVIEW_STRUCTURE_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.GET_TASKS_LIST_BY_PROCESS_DEFINITION_ID_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.IMPORT_PROCESS_DEFINE_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.QUERY_DETAIL_OF_PROCESS_DEFINITION_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_DEFINITION_LIST;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_DEFINITION_LIST_PAGING_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.QUERY_PROCESS_DEFINITION_VERSIONS_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.RELEASE_PROCESS_DEFINITION_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.SWITCH_PROCESS_DEFINITION_VERSION_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_PROCESS_DEFINITION_ERROR;
|
|
|
-import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR;
|
|
|
-
|
|
|
import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation;
|
|
|
import org.apache.dolphinscheduler.api.enums.Status;
|
|
|
import org.apache.dolphinscheduler.api.exceptions.ApiException;
|
|
@@ -49,6 +31,7 @@ import org.apache.dolphinscheduler.dao.entity.User;
|
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
+import java.text.MessageFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -80,6 +63,8 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
+import static org.apache.dolphinscheduler.api.enums.Status.*;
|
|
|
+
|
|
|
|
|
|
* process definition controller
|
|
|
*/
|
|
@@ -660,17 +645,17 @@ public class ProcessDefinitionController extends BaseController {
|
|
|
try {
|
|
|
Map<String, Object> deleteResult = processDefinitionService.deleteProcessDefinitionByCode(loginUser, projectCode, code);
|
|
|
if (!Status.SUCCESS.equals(deleteResult.get(Constants.STATUS))) {
|
|
|
- deleteFailedCodeList.add(strProcessDefinitionCode);
|
|
|
+ deleteFailedCodeList.add((String) deleteResult.get(Constants.MSG));
|
|
|
logger.error((String) deleteResult.get(Constants.MSG));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- deleteFailedCodeList.add(strProcessDefinitionCode);
|
|
|
+ deleteFailedCodeList.add(MessageFormat.format(Status.DELETE_PROCESS_DEFINE_BY_CODES_ERROR.getMsg(), strProcessDefinitionCode));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (!deleteFailedCodeList.isEmpty()) {
|
|
|
- putMsg(result, BATCH_DELETE_PROCESS_DEFINE_BY_CODES_ERROR, String.join(",", deleteFailedCodeList));
|
|
|
+ putMsg(result, BATCH_DELETE_PROCESS_DEFINE_BY_CODES_ERROR, String.join("\n", deleteFailedCodeList));
|
|
|
} else {
|
|
|
putMsg(result, Status.SUCCESS);
|
|
|
}
|