simon824 commented on a change in pull request #2872:
URL: 
https://github.com/apache/incubator-dolphinscheduler/pull/2872#discussion_r436230517



##########
File path: 
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionService.java
##########
@@ -756,8 +756,13 @@ private boolean checkTaskHasSubProcess(String taskType) {
     public Map<String, Object> importProcessDefinition(User loginUser, 
MultipartFile file, String currentProjectName) {
         Map<String, Object> result = new HashMap<>(5);
         String processMetaJson = FileUtils.file2String(file);
-        List<ProcessMeta> processMetaList = JSON.parseArray(processMetaJson, 
ProcessMeta.class);
+        List<ProcessMeta> processMetaList = new ArrayList<>();
 
+        try {
+            processMetaList = JSONUtils.getMapper().readValue(processMetaJson, 
new TypeReference<List<ProcessMeta>>() {});

Review comment:
       toList will return List<LinkedHashMap> and will Cause  exception :
    " Could not write JSON: java.util.LinkedHashMap cannot be cast to 
org.apache.dolphinscheduler.common.process.Property"




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