You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ca...@apache.org on 2022/03/28 12:33:22 UTC

[dolphinscheduler] branch dev updated: [Bug] [ALERT-9224] fix wechat alert functions: app and group chat (#9225)

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

caishunfeng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 03a0c9f  [Bug] [ALERT-9224] fix wechat alert functions: app and group chat (#9225)
03a0c9f is described below

commit 03a0c9f54429956cd399de0829aa70c11b67934d
Author: Tq <ti...@gmail.com>
AuthorDate: Mon Mar 28 20:33:14 2022 +0800

    [Bug] [ALERT-9224] fix wechat alert functions: app and group chat (#9225)
    
    * fix wechat alert with app and group chat
    
    * add apache header and fix imports
    
    * delete wechat alert 'userSendMsg' property code
    
    * delete wechat alert 'userSendMsg' property code in Test
    
    * delete wechat alert 'userSendMsg' property code in factory Test
    
    * change `getSubWorkFlowParam` from private to protected
---
 .../alert/wechat/WeChatAlertChannelFactory.java    |   9 +-
 .../plugin/alert/wechat/WeChatAlertConstants.java  |  12 +++
 .../alert/wechat/WeChatAlertParamsConstants.java   |   3 +-
 .../plugin/alert/wechat/WeChatSender.java          |  35 +++-----
 .../plugin/alert/wechat/WechatAppChatMessage.java  |  70 +++++++++++++++
 .../plugin/alert/wechat/WechatAppMessage.java      | 100 +++++++++++++++++++++
 .../wechat/WeChatAlertChannelFactoryTest.java      |   2 +-
 .../plugin/alert/wechat/WeChatSenderTest.java      |   4 -
 .../service/process/ProcessService.java            |   2 +-
 9 files changed, 198 insertions(+), 39 deletions(-)

diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java
index ef5fc6f..a77daf7 100644
--- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactory.java
@@ -62,13 +62,6 @@ public final class WeChatAlertChannelFactory implements AlertChannelFactory {
                                                                .build())
                                           .build();
 
-        InputParam userSendMsgParam = InputParam.newBuilder(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USER_SEND_MSG, WeChatAlertParamsConstants.ENTERPRISE_WE_CHAT_USER_SEND_MSG)
-                                                .setPlaceholder("please input corp id ")
-                                                .addValidate(Validate.newBuilder()
-                                                                     .setRequired(true)
-                                                                     .build())
-                                                .build();
-
         InputParam agentIdParam = InputParam.newBuilder(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_AGENT_ID, WeChatAlertParamsConstants.ENTERPRISE_WE_CHAT_AGENT_ID)
                                             .setPlaceholder("please input agent id ")
                                             .addValidate(Validate.newBuilder()
@@ -90,7 +83,7 @@ public final class WeChatAlertChannelFactory implements AlertChannelFactory {
                                         .addValidate(Validate.newBuilder().setRequired(true).build())
                                         .build();
 
-        return Arrays.asList(corpIdParam, secretParam, usersParam, userSendMsgParam, agentIdParam, sendType, showType);
+        return Arrays.asList(corpIdParam, secretParam, usersParam, agentIdParam, sendType, showType);
     }
 
     @Override
diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertConstants.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertConstants.java
index 9c90d63..36ebc1c 100644
--- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertConstants.java
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertConstants.java
@@ -31,6 +31,18 @@ public final class WeChatAlertConstants {
 
     static final String WE_CHAT_TOKEN_URL = "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid={corpId}&corpsecret={secret}";
 
+    static final String WE_CHAT_CONTENT_KEY = "content";
+
+    static final String WE_CHAT_MESSAGE_TYPE_TEXT = "text";
+
+    static final Integer WE_CHAT_MESSAGE_SAFE_PUBLICITY = 0;
+
+    static final Integer WE_CHAT_MESSAGE_SAFE_PRIVACY = 1;
+
+    static final Integer WE_CHAT_ENABLE_ID_TRANS = 0;
+
+    static final Integer WE_CHAT_DUPLICATE_CHECK_INTERVAL_ZERO = 0;
+
     private WeChatAlertConstants() {
         throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
     }
diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertParamsConstants.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertParamsConstants.java
index 5cf9e40..db9813d 100644
--- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertParamsConstants.java
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertParamsConstants.java
@@ -24,10 +24,9 @@ public final class WeChatAlertParamsConstants {
     static final String NAME_ENTERPRISE_WE_CHAT_SECRET = "secret";
     static final String ENTERPRISE_WE_CHAT_TEAM_SEND_MSG = "$t('teamSendMsg')";
     static final String NAME_ENTERPRISE_WE_CHAT_TEAM_SEND_MSG = "teamSendMsg";
-    static final String ENTERPRISE_WE_CHAT_USER_SEND_MSG = "$t('userSendMsg')";
-    static final String NAME_ENTERPRISE_WE_CHAT_USER_SEND_MSG = "userSendMsg";
     static final String ENTERPRISE_WE_CHAT_AGENT_ID = "$t('agentId')";
     static final String NAME_ENTERPRISE_WE_CHAT_AGENT_ID = "agentId";
+    static final String NAME_ENTERPRISE_WE_CHAT_CHAT_ID = "chatId";
     static final String ENTERPRISE_WE_CHAT_USERS = "$t('users')";
     static final String NAME_ENTERPRISE_WE_CHAT_USERS = "users";
 
diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSender.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSender.java
index badd6f2..8dfdf50 100644
--- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSender.java
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSender.java
@@ -18,6 +18,7 @@
 package org.apache.dolphinscheduler.plugin.alert.wechat;
 
 import static java.util.Objects.requireNonNull;
+import static org.apache.dolphinscheduler.plugin.alert.wechat.WeChatAlertConstants.*;
 
 import org.apache.dolphinscheduler.alert.api.AlertConstants;
 import org.apache.dolphinscheduler.alert.api.AlertResult;
@@ -35,8 +36,6 @@ import org.apache.http.impl.client.HttpClients;
 import org.apache.http.util.EntityUtils;
 
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -59,8 +58,8 @@ public final class WeChatSender {
     private static final String SECRET_REGEX = "{secret}";
     private static final String TOKEN_REGEX = "{token}";
     private final String weChatAgentId;
+    private final String weChatChatId;
     private final String weChatUsers;
-    private final String weChatUserSendMsg;
     private final String weChatTokenUrlReplace;
     private final String weChatToken;
     private final String sendType;
@@ -68,11 +67,11 @@ public final class WeChatSender {
 
     WeChatSender(Map<String, String> config) {
         weChatAgentId = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_AGENT_ID);
+        weChatChatId = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_CHAT_ID);
         weChatUsers = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USERS);
         String weChatCorpId = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_CORP_ID);
         String weChatSecret = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_SECRET);
         String weChatTokenUrl = WeChatAlertConstants.WE_CHAT_TOKEN_URL;
-        weChatUserSendMsg = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USER_SEND_MSG);
         sendType = config.get(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_SEND_TYPE);
         showType = config.get(AlertConstants.NAME_SHOW_TYPE);
         requireNonNull(showType, AlertConstants.NAME_SHOW_TYPE + MUST_NOT_NULL);
@@ -96,7 +95,7 @@ public final class WeChatSender {
                 response.close();
             }
             logger.info("Enterprise WeChat send [{}], param:{}, resp:{}",
-                url, data, resp);
+                    url, data, resp);
             return resp;
         }
     }
@@ -229,30 +228,13 @@ public final class WeChatSender {
     }
 
     /**
-     * make user multi user message
-     *
-     * @param toUser the toUser
-     * @param agentId the agentId
-     * @param msg the msg
-     * @return Enterprise WeChat send message
-     */
-    private String makeUserSendMsg(Collection<String> toUser, String agentId, String msg) {
-        String listUser = mkString(toUser);
-        return weChatUserSendMsg.replace(USER_REG_EXP, listUser)
-                                .replace(AGENT_ID_REG_EXP, agentId)
-                                .replace(MSG_REG_EXP, msg);
-    }
-
-    /**
      * send Enterprise WeChat
      *
      * @return Enterprise WeChat resp, demo: {"errcode":0,"errmsg":"ok","invaliduser":""}
      */
     public AlertResult sendEnterpriseWeChat(String title, String content) {
         AlertResult alertResult;
-        List<String> userList = Arrays.asList(weChatUsers.split(","));
         String data = markdownByAlert(title, content);
-        String msg = makeUserSendMsg(userList, weChatAgentId, data);
         if (null == weChatToken) {
             alertResult = new AlertResult();
             alertResult.setMessage("send we chat alert fail,get weChat token error");
@@ -260,14 +242,21 @@ public final class WeChatSender {
             return alertResult;
         }
         String enterpriseWeChatPushUrlReplace = "";
+        Map<String,String> contentMap=new HashMap<>();
+        contentMap.put(WeChatAlertConstants.WE_CHAT_CONTENT_KEY,data);
+        String msgJson="";
         if (sendType.equals(WeChatType.APP.getDescp())) {
             enterpriseWeChatPushUrlReplace = WeChatAlertConstants.WE_CHAT_PUSH_URL.replace(TOKEN_REGEX, weChatToken);
+            WechatAppMessage wechatAppMessage=new WechatAppMessage(weChatUsers, WE_CHAT_MESSAGE_TYPE_TEXT, Integer.valueOf(weChatAgentId),contentMap, WE_CHAT_MESSAGE_SAFE_PUBLICITY, WE_CHAT_ENABLE_ID_TRANS, WE_CHAT_DUPLICATE_CHECK_INTERVAL_ZERO);
+            msgJson=JSONUtils.toJsonString(wechatAppMessage);
         } else if (sendType.equals(WeChatType.APPCHAT.getDescp())) {
             enterpriseWeChatPushUrlReplace = WeChatAlertConstants.WE_CHAT_APP_CHAT_PUSH_URL.replace(TOKEN_REGEX, weChatToken);
+            WechatAppChatMessage wechatAppChatMessage=new WechatAppChatMessage(weChatChatId, WE_CHAT_MESSAGE_TYPE_TEXT, contentMap, WE_CHAT_MESSAGE_SAFE_PUBLICITY);
+            msgJson=JSONUtils.toJsonString(wechatAppChatMessage);
         }
 
         try {
-            return checkWeChatSendMsgResult(post(enterpriseWeChatPushUrlReplace, msg));
+            return checkWeChatSendMsgResult(post(enterpriseWeChatPushUrlReplace, msgJson));
         } catch (Exception e) {
             logger.info("send we chat alert msg  exception : {}", e.getMessage());
             alertResult = new AlertResult();
diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WechatAppChatMessage.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WechatAppChatMessage.java
new file mode 100644
index 0000000..5294972
--- /dev/null
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WechatAppChatMessage.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.plugin.alert.wechat;
+
+import java.util.Map;
+
+public class WechatAppChatMessage {
+
+    private String chatid;
+    private String msgtype;
+    private Map<String,String> text;
+    private Integer safe;
+
+    public String getChatid() {
+        return chatid;
+    }
+
+    public void setChatid(String chatid) {
+        this.chatid = chatid;
+    }
+
+    public String getMsgtype() {
+        return msgtype;
+    }
+
+    public void setMsgtype(String msgtype) {
+        this.msgtype = msgtype;
+    }
+
+    public Map<String, String> getText() {
+        return text;
+    }
+
+    public void setText(Map<String, String> text) {
+        this.text = text;
+    }
+
+    public Integer getSafe() {
+        return safe;
+    }
+
+    public void setSafe(Integer safe) {
+        this.safe = safe;
+    }
+
+    public WechatAppChatMessage() {
+    }
+
+    public WechatAppChatMessage(String chatid, String msgtype, Map<String, String> text, Integer safe) {
+        this.chatid = chatid;
+        this.msgtype = msgtype;
+        this.text = text;
+        this.safe = safe;
+    }
+}
diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WechatAppMessage.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WechatAppMessage.java
new file mode 100644
index 0000000..4032e48
--- /dev/null
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/main/java/org/apache/dolphinscheduler/plugin/alert/wechat/WechatAppMessage.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dolphinscheduler.plugin.alert.wechat;
+
+import java.util.Map;
+
+public class WechatAppMessage {
+
+    private String touser;
+    private String msgtype;
+    private Integer agentid;
+    private Map<String,String> text;
+    private Integer safe;
+    private Integer enable_id_trans;
+    private Integer enable_duplicate_check;
+
+    public String getTouser() {
+        return touser;
+    }
+
+    public void setTouser(String touser) {
+        this.touser = touser;
+    }
+
+    public String getMsgtype() {
+        return msgtype;
+    }
+
+    public void setMsgtype(String msgtype) {
+        this.msgtype = msgtype;
+    }
+
+    public Integer getAgentid() {
+        return agentid;
+    }
+
+    public void setAgentid(Integer agentid) {
+        this.agentid = agentid;
+    }
+
+    public Map<String, String> getText() {
+        return text;
+    }
+
+    public void setText(Map<String, String> text) {
+        this.text = text;
+    }
+
+    public Integer getSafe() {
+        return safe;
+    }
+
+    public void setSafe(Integer safe) {
+        this.safe = safe;
+    }
+
+    public Integer getEnable_id_trans() {
+        return enable_id_trans;
+    }
+
+    public void setEnable_id_trans(Integer enable_id_trans) {
+        this.enable_id_trans = enable_id_trans;
+    }
+
+    public Integer getEnable_duplicate_check() {
+        return enable_duplicate_check;
+    }
+
+    public void setEnable_duplicate_check(Integer enable_duplicate_check) {
+        this.enable_duplicate_check = enable_duplicate_check;
+    }
+
+    public WechatAppMessage() {
+    }
+
+    public WechatAppMessage(String touser, String msgtype, Integer agentid, Map<String, String> text, Integer safe, Integer enable_id_trans, Integer enable_duplicate_check) {
+        this.touser = touser;
+        this.msgtype = msgtype;
+        this.agentid = agentid;
+        this.text = text;
+        this.safe = safe;
+        this.enable_id_trans = enable_id_trans;
+        this.enable_duplicate_check = enable_duplicate_check;
+    }
+}
diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactoryTest.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactoryTest.java
index 648c206..04ecc36 100644
--- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactoryTest.java
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatAlertChannelFactoryTest.java
@@ -36,7 +36,7 @@ public class WeChatAlertChannelFactoryTest {
         WeChatAlertChannelFactory weChatAlertChannelFactory = new WeChatAlertChannelFactory();
         List<PluginParams> params = weChatAlertChannelFactory.params();
         JSONUtils.toJsonString(params);
-        Assert.assertEquals(7, params.size());
+        Assert.assertEquals(6, params.size());
     }
 
     @Test
diff --git a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSenderTest.java b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSenderTest.java
index 73d889b..77ee0c2 100644
--- a/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSenderTest.java
+++ b/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-wechat/src/test/java/org/apache/dolphinscheduler/plugin/alert/wechat/WeChatSenderTest.java
@@ -61,10 +61,6 @@ public class WeChatSenderTest {
         weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_AGENT_ID, "100000");
         weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_CORP_ID, "NAME_ENTERPRISE_WE_CHAT_CORP_ID");
         weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_SECRET, "NAME_ENTERPRISE_WE_CHAT_SECRET");
-        weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USER_SEND_MSG, "{\"touser\":\"{toUser}\",\"agentid\":{agentId}"
-            +
-            ",\"msgtype\":\"markdown\",\"markdown\":{\"content\":\"{msg}\"}}"
-        );
         weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_USERS, "Kris");
         weChatConfig.put(WeChatAlertParamsConstants.NAME_ENTERPRISE_WE_CHAT_TEAM_SEND_MSG, "msg");
         weChatConfig.put(AlertConstants.NAME_SHOW_TYPE, ShowType.TABLE.getDescp());
diff --git a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
index cf12b05..8a9427f 100644
--- a/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
+++ b/dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
@@ -1307,7 +1307,7 @@ public class ProcessService {
     /**
      * complement data needs transform parent parameter to child.
      */
-    private String getSubWorkFlowParam(ProcessInstanceMap instanceMap, ProcessInstance parentProcessInstance, Map<String, String> fatherParams) {
+    protected String getSubWorkFlowParam(ProcessInstanceMap instanceMap, ProcessInstance parentProcessInstance, Map<String, String> fatherParams) {
         // set sub work process command
         String processMapStr = JSONUtils.toJsonString(instanceMap);
         Map<String, String> cmdParam = JSONUtils.toMap(processMapStr);