diff --git a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/ProcessResponse.java b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/ProcessResponse.java index 215fbb3051f..059e8edb82d 100644 --- a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/ProcessResponse.java +++ b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/ProcessResponse.java @@ -77,6 +77,6 @@ public class ProcessResponse { private List currentTasks; @ApiModelProperty(value = "Extra information shown in the list") - private Map showInList; + private List> showInList; } diff --git a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/TaskResponse.java b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/TaskResponse.java index 519d6a7c168..06cae85145d 100644 --- a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/TaskResponse.java +++ b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/TaskResponse.java @@ -89,6 +89,6 @@ public class TaskResponse { private Object extParams; @ApiModelProperty(value = "Extra information shown in the list") - private Map showInList; + private List> showInList; } diff --git a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ApplyConsumeProcessForm.java b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ApplyConsumeProcessForm.java index 4b6792604c4..10db1197fcd 100644 --- a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ApplyConsumeProcessForm.java +++ b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ApplyConsumeProcessForm.java @@ -26,6 +26,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.ArrayList; +import java.util.List; import java.util.Map; /** @@ -56,12 +58,14 @@ public String getInlongGroupId() { } @Override - public Map showInList() { + public List> showInList() { + List> showInList = new ArrayList<>(); Map show = Maps.newHashMap(); if (consumeInfo != null) { show.put("inlongGroupId", consumeInfo.getInlongGroupId()); show.put("consumerGroup", consumeInfo.getConsumerGroup()); } - return show; + showInList.add(show); + return showInList; } } diff --git a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ApplyGroupProcessForm.java b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ApplyGroupProcessForm.java index 27d3e30b709..272052f514d 100644 --- a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ApplyGroupProcessForm.java +++ b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ApplyGroupProcessForm.java @@ -79,23 +79,24 @@ public String getInlongGroupId() { } @Override - public Map showInList() { - Map show = Maps.newHashMap(); + public List> showInList() { + List> showList = new ArrayList<>(); if (groupInfo != null) { - show.put("inlongGroupId", groupInfo.getInlongGroupId()); - show.put("inlongGroupMode", groupInfo.getInlongGroupMode()); - } else { - List groupIdList = new ArrayList<>(); - List groupModeList = new ArrayList<>(); - groupFullInfoList.forEach(v -> { - InlongGroupInfo groupInfo = v.getGroupInfo(); - groupIdList.add(groupInfo.getInlongGroupId()); - groupModeList.add(groupInfo.getInlongGroupMode()); + addShowInfo(groupInfo, showList); + } + if (CollectionUtils.isNotEmpty(groupFullInfoList)) { + groupFullInfoList.forEach(groupFullInfo -> { + addShowInfo(groupFullInfo.getGroupInfo(), showList); }); - show.put("inlongGroupId", Joiner.on(",").join(groupIdList)); - show.put("inlongGroupMode", Joiner.on(",").join(groupModeList)); } - return show; + return showList; + } + + private void addShowInfo(InlongGroupInfo groupInfo, List> showList) { + Map show = Maps.newHashMap(); + show.put("inlongGroupId", groupInfo.getInlongGroupId()); + show.put("inlongGroupMode", groupInfo.getInlongGroupMode()); + showList.add(show); } @Data diff --git a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/GroupResourceProcessForm.java b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/GroupResourceProcessForm.java index d955a2c5a66..1dd1294653b 100644 --- a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/GroupResourceProcessForm.java +++ b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/GroupResourceProcessForm.java @@ -26,6 +26,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -61,11 +62,13 @@ public String getInlongGroupId() { } @Override - public Map showInList() { + public List> showInList() { + List> showInList = new ArrayList<>(); Map show = new HashMap<>(); show.put("inlongGroupId", groupInfo.getInlongGroupId()); show.put("groupOperateType", this.groupOperateType); - return show; + showInList.add(show); + return showInList; } } diff --git a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ProcessForm.java b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ProcessForm.java index 95f4d1451c4..bcf1278e971 100644 --- a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ProcessForm.java +++ b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/workflow/form/process/ProcessForm.java @@ -21,6 +21,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; +import java.util.List; import java.util.Map; /** @@ -47,7 +48,7 @@ default String getTitle() { /** * Field data displayed in the process list. */ - default Map showInList() { + default List> showInList() { return null; } diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/WorkflowServiceImpl.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/WorkflowServiceImpl.java index 0863b8e6661..739b68fcab5 100644 --- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/WorkflowServiceImpl.java +++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/WorkflowServiceImpl.java @@ -244,7 +244,7 @@ private Consumer addCurrentTask(TaskRequest query) { }; } - private Map getShowInList(WorkflowProcessEntity processEntity) { + private List> getShowInList(WorkflowProcessEntity processEntity) { WorkflowProcess process = processDefService.getByName(processEntity.getName()); if (process == null || process.getFormClass() == null) { return null; @@ -270,7 +270,7 @@ private void addShowInListForEachTask(List taskList) { query.setIdList(list); List processEntities = queryService.listProcessEntity(query); - Map> processShowInListMap = Maps.newHashMap(); + Map>> processShowInListMap = Maps.newHashMap(); processEntities.forEach(entity -> processShowInListMap.put(entity.getId(), getShowInList(entity))); taskList.forEach(task -> task.setShowInList(processShowInListMap.get(task.getProcessId()))); }