zixi0825 commented on a change in pull request #2884:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/2884#discussion_r447369400



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
##########
@@ -295,36 +295,188 @@ private String getResourceIds(ProcessData processData) {
 
     /**
      * copy process definition
-     *
      * @param loginUser   login user
-     * @param projectName project name
      * @param processId   process definition id
      * @return copy result code
      */
-    public Map<String, Object> copyProcessDefinition(User loginUser, String 
projectName, Integer processId) throws JsonProcessingException {
+    private Map<String, Object> copyProcessDefinition(User loginUser,
+                                                     Integer processId,
+                                                     String targetProjectName) 
throws JsonProcessingException {
 
         Map<String, Object> result = new HashMap<>(5);
+
+        ProcessDefinition processDefinition = 
processDefineMapper.selectById(processId);
+        if (processDefinition == null) {
+            putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, processId);
+            return result;
+        } else {
+            Project targetProject = 
projectMapper.queryByName(targetProjectName);

Review comment:
       
![image](https://user-images.githubusercontent.com/10829956/86075862-98987380-babb-11ea-9a4c-b538c7ea7d3a.png)
   What you see should be old code, the new code has fixed.




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