zhuangchong opened a new pull request #3879:
URL: https://github.com/apache/incubator-dolphinscheduler/pull/3879


   ## What is the purpose of the pull request
   
   this branch merge to branch 1.3.3-release (#3864  branch merge to branch dev)
   
   #3843
   
   problem:
   The workflow definition name already exists, saved workflow ,prompt: update 
workflow definition error
   
   The reason for this problem is that the user tenant or queue or project is 
empty. When the workflow definition is saved, the verification of the workflow 
definition name fails, the projectId and processDefineName construct unique 
constraints, and the workflow update fails when the data is saved.
   
   I think that the workflow definition name verification only needs to verify 
the existence of projectId and processDefineName,The original query method is 
called in many places without modification.
   
   ```
    select pd.*,u.user_name,p.name as 
project_name,t.tenant_code,t.tenant_name,q.queue,q.queue_name
           from t_ds_process_definition pd
           JOIN t_ds_user u ON pd.user_id = u.id
           JOIN  t_ds_project p ON pd.project_id = p.id
           JOIN  t_ds_tenant t ON t.id = u.tenant_id
           JOIN t_ds_queue q ON t.queue_id = q.id
           WHERE p.id = #{projectId}
           and pd.name = #{processDefinitionName}
   add verifyByDefineName
   ```
   
   ```
   select pd.*
           from t_ds_process_definition pd
           WHERE pd.project_id = #{projectId}
           and pd.name = #{processDefinitionName}
   ```
   
   ## Brief change log
   
   add ProcessDefinitionMapper.verifyByDefineName(int projectId,String name)
   
   ## Verify this pull request
   This change added tests and can be verified as follows:
     - *Manually verified the change by testing locally.*
   
   ---
   
   ##拉取请求的目的是什么
   问题
   工作流程定义名称已存在,更新工作流定义,保存名称,提示:更新工作流程定义错误
   
   
出现这个问题的原因,用户租户或队列或项目为空导致,导致工作流定义保存时,工作流定义名称验证失败,projectId和processDefineName构建唯一约束,数据保存时报工作流更新失败。
   
   我认为工作流定义名称验证,只需要验证projectId和processDefineName是否存在即可,原查询方法多处调用,并未做修改。
   
   ```
    select pd.*,u.user_name,p.name as 
project_name,t.tenant_code,t.tenant_name,q.queue,q.queue_name
           from t_ds_process_definition pd
           JOIN t_ds_user u ON pd.user_id = u.id
           JOIN  t_ds_project p ON pd.project_id = p.id
           JOIN  t_ds_tenant t ON t.id = u.tenant_id
           JOIN t_ds_queue q ON t.queue_id = q.id
           WHERE p.id = #{projectId}
           and pd.name = #{processDefinitionName}
   add verifyByDefineName
   ```
   
   ```
   select pd.*
           from t_ds_process_definition pd
           WHERE pd.project_id = #{projectId}
           and pd.name = #{processDefinitionName}
   ```
   
   ##简要更改日志
   
   新增ProcessDefinitionMapper.verifyByDefineName(int projectId,String name)


----------------------------------------------------------------
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