zhuangchong commented on a change in pull request #4569:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/4569#discussion_r564336836



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
##########
@@ -495,7 +495,7 @@ private String getResourceIds(ProcessData processData) {
         if (processDefinition == null) {
             putMsg(result, Status.SUCCESS);
         } else {
-            putMsg(result, Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR, 
name);
+            putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name);

Review comment:
       VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR state is used for prompt 
verifyProcessDefinitionName method throws an exception
   
   ```
   @ApiException(VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR)
       public Result verifyProcessDefinitionName(@ApiIgnore 
@RequestAttribute(value = Constants.SESSION_USER) User loginUser,
                                                 @ApiParam(name = 
"projectName", value = "PROJECT_NAME", required = true) @PathVariable String 
projectName,
                                                 @RequestParam(value = "name", 
required = true) String name) {
           logger.info("verify process definition name unique, user:{}, project 
name:{}, process definition name:{}",
               loginUser.getUserName(), projectName, name);
           Map<String, Object> result = 
processDefinitionService.verifyProcessDefinitionName(loginUser, projectName, 
name);
           return returnDataList(result);
       }
   
   ```
   
   PROCESS_DEFINITION_NAME_EXIST state is the prompt used to verify the 
existence of the workflow definition name
   
   ```
   ProcessDefinition processDefinition = 
processDefineMapper.verifyByDefineName(project.getId(), name);
           if (processDefinition == null) {
               putMsg(result, Status.SUCCESS);
           } else {
               putMsg(result, Status.PROCESS_DEFINITION_NAME_EXIST, name);
           }
   
    ```
   
   I think the VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR and 
PROCESS_DEFINITION_NAME_EXIST states are both required.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to