You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/01/27 03:06:40 UTC

[GitHub] [incubator-dolphinscheduler] zhuangchong commented on issue #4568: [Improvement][API] When the workflow definition name validation API fails, the system prompts that the workflow definition name already exists

zhuangchong commented on issue #4568:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/4568#issuecomment-767983929


   > I think "workflow name already exists" is clearer, and I don't know where the error is when I prompt "workflow name verification error"
   
   I didn't express myself clearly. I'm going to change it this way
   
   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:
users@infra.apache.org