You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by go...@apache.org on 2021/12/15 09:20:16 UTC

[incubator-inlong] branch master updated: [INLONG-1984][Bug][InLong-Manager] Set Pulsar params for workflow form after submitting approval (#2000)

This is an automated email from the ASF dual-hosted git repository.

gosonzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 8a8831e  [INLONG-1984][Bug][InLong-Manager] Set Pulsar params for workflow form after submitting approval (#2000)
8a8831e is described below

commit 8a8831e6282df584cda00dd1a869b8987187a604
Author: healchow <he...@gmail.com>
AuthorDate: Wed Dec 15 17:19:55 2021 +0800

    [INLONG-1984][Bug][InLong-Manager] Set Pulsar params for workflow form after submitting approval (#2000)
    
    Co-authored-by: healchow <he...@gmail.com>
---
 .../service/core/impl/BusinessProcessOperation.java    | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/BusinessProcessOperation.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/BusinessProcessOperation.java
index 081aa5f..13d4148 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/BusinessProcessOperation.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/BusinessProcessOperation.java
@@ -24,17 +24,19 @@ import org.apache.inlong.manager.common.enums.BizErrorCodeEnum;
 import org.apache.inlong.manager.common.enums.EntityStatus;
 import org.apache.inlong.manager.common.exceptions.BusinessException;
 import org.apache.inlong.manager.common.pojo.business.BusinessInfo;
+import org.apache.inlong.manager.common.pojo.business.BusinessPulsarInfo;
 import org.apache.inlong.manager.common.pojo.datastream.DataStreamSummaryInfo;
 import org.apache.inlong.manager.common.util.CommonBeanUtils;
+import org.apache.inlong.manager.common.util.Preconditions;
 import org.apache.inlong.manager.dao.entity.BusinessEntity;
+import org.apache.inlong.manager.dao.entity.BusinessPulsarEntity;
 import org.apache.inlong.manager.dao.mapper.BusinessEntityMapper;
+import org.apache.inlong.manager.dao.mapper.BusinessPulsarEntityMapper;
 import org.apache.inlong.manager.service.core.DataStreamService;
-import org.apache.inlong.manager.service.core.StorageService;
 import org.apache.inlong.manager.service.workflow.ProcessName;
 import org.apache.inlong.manager.service.workflow.WorkflowResult;
 import org.apache.inlong.manager.service.workflow.WorkflowService;
 import org.apache.inlong.manager.service.workflow.business.NewBusinessWorkflowForm;
-import org.apache.inlong.manager.common.util.Preconditions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,15 +49,14 @@ import org.springframework.stereotype.Service;
 public class BusinessProcessOperation {
 
     private static final Logger LOGGER = LoggerFactory.getLogger(BusinessProcessOperation.class);
-
+    @Autowired
+    BusinessPulsarEntityMapper businessPulsarMapper;
     @Autowired
     private BusinessEntityMapper businessMapper;
     @Autowired
     private WorkflowService workflowService;
     @Autowired
     private DataStreamService streamService;
-    @Autowired
-    private StorageService storageService;
 
     /**
      * Allocate resource application groups for access services and initiate an approval process
@@ -97,6 +98,13 @@ public class BusinessProcessOperation {
         NewBusinessWorkflowForm form = new NewBusinessWorkflowForm();
         form.setBusinessInfo(businessInfo);
 
+        if (BizConstant.MIDDLEWARE_PULSAR.equalsIgnoreCase(businessInfo.getMiddlewareType())) {
+            BusinessPulsarEntity pulsarEntity = businessPulsarMapper.selectByGroupId(businessInfo.getInlongGroupId());
+            BusinessPulsarInfo pulsarInfo = CommonBeanUtils.copyProperties(pulsarEntity, BusinessPulsarInfo::new);
+            businessInfo.setMqExtInfo(pulsarInfo);
+        }
+        form.setBusinessInfo(businessInfo);
+
         // Query all data streams under the groupId and the storage information of each data stream
         List<DataStreamSummaryInfo> infoList = streamService.getSummaryList(businessInfo.getInlongGroupId());
         form.setStreamInfoList(infoList);