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

SbloodyS 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 ffeba8f906 [Improvement-18556][API] Remove obsolete dynamic 
sub-workflow API (#18557)
ffeba8f906 is described below

commit ffeba8f906e1dd6e2e459c41d4d6a932e93a24da
Author: Wenjun Ruan <[email protected]>
AuthorDate: Tue Aug 18 09:14:42 2026 +0800

    [Improvement-18556][API] Remove obsolete dynamic sub-workflow API (#18557)
---
 docs/docs/en/guide/upgrade/incompatible.md         |  1 +
 docs/docs/zh/guide/upgrade/incompatible.md         |  1 +
 .../api/controller/WorkflowInstanceController.java | 22 --------
 .../api/dto/DynamicSubWorkflowDto.java             | 41 ---------------
 .../api/service/WorkflowInstanceService.java       |  4 --
 .../service/impl/WorkflowInstanceServiceImpl.java  | 59 ----------------------
 .../common/constants/CommandKeyConstants.java      |  2 -
 .../dao/mapper/RelationSubWorkflowMapper.java      |  3 --
 .../dao/mapper/RelationSubWorkflowMapper.xml       |  7 ---
 9 files changed, 2 insertions(+), 138 deletions(-)

diff --git a/docs/docs/en/guide/upgrade/incompatible.md 
b/docs/docs/en/guide/upgrade/incompatible.md
index 026d9b88bb..dd8e482802 100644
--- a/docs/docs/en/guide/upgrade/incompatible.md
+++ b/docs/docs/en/guide/upgrade/incompatible.md
@@ -47,4 +47,5 @@ This document records the incompatible updates between each 
version. You need to
 ## 3.5.0
 
 * Add the `missed_fire_policy` column to `t_ds_schedules`. Existing schedules 
default to `FIRE_ALL_MISSED` to preserve the previous Quartz `IgnoreMisfires` 
behavior. ([#18464](https://github.com/apache/dolphinscheduler/pull/18464))
+* Remove the obsolete Dynamic Task query API. 
([#18556](https://github.com/apache/dolphinscheduler/issues/18556))
 
diff --git a/docs/docs/zh/guide/upgrade/incompatible.md 
b/docs/docs/zh/guide/upgrade/incompatible.md
index db0ea2d4c5..ee324952dd 100644
--- a/docs/docs/zh/guide/upgrade/incompatible.md
+++ b/docs/docs/zh/guide/upgrade/incompatible.md
@@ -47,4 +47,5 @@
 ## 3.5.0
 
 * 为 `t_ds_schedules` 表新增 `missed_fire_policy` 字段。现有定时默认使用 
`FIRE_ALL_MISSED`,以保持原有 Quartz `IgnoreMisfires` 
行为。([#18464](https://github.com/apache/dolphinscheduler/pull/18464))
+* 移除已废弃的 Dynamic Task 
查询接口。([#18556](https://github.com/apache/dolphinscheduler/issues/18556))
 
diff --git 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowInstanceController.java
 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowInstanceController.java
index 221acd99bd..c99c2aaf36 100644
--- 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowInstanceController.java
+++ 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/WorkflowInstanceController.java
@@ -21,7 +21,6 @@ import static 
org.apache.dolphinscheduler.api.enums.Status.QUERY_WORKFLOW_INSTAN
 
 import org.apache.dolphinscheduler.api.audit.OperatorLog;
 import org.apache.dolphinscheduler.api.audit.enums.AuditType;
-import org.apache.dolphinscheduler.api.dto.DynamicSubWorkflowDto;
 import org.apache.dolphinscheduler.api.dto.gantt.GanttDto;
 import 
org.apache.dolphinscheduler.api.dto.workflowInstance.WorkflowInstanceTaskListDTO;
 import 
org.apache.dolphinscheduler.api.dto.workflowInstance.WorkflowInstanceVariablesDTO;
@@ -313,27 +312,6 @@ public class WorkflowInstanceController extends 
BaseController {
         return Result.success(data);
     }
 
-    /**
-     * query dynamic sub workflow instance detail info by task id
-     *
-     * @param loginUser login user
-     * @param taskId task id
-     * @return sub workflow instance detail
-     */
-    @Operation(summary = "queryDynamicSubWorkflowInstances", description = 
"QUERY_DYNAMIC_SUB_WORKFLOW_INSTANCE_BY_TASK_CODE_NOTES")
-    @Parameters({
-            @Parameter(name = "taskId", description = "taskInstanceId", 
required = true, schema = @Schema(implementation = int.class, example = "100"))
-    })
-    @GetMapping(value = "/query-dynamic-sub-workflows")
-    @ResponseStatus(HttpStatus.OK)
-    
@ApiException(Status.QUERY_SUB_WORKFLOW_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR)
-    public Result<List<DynamicSubWorkflowDto>> 
queryDynamicSubWorkflowInstances(@Parameter(hidden = true) 
@RequestAttribute(value = Constants.SESSION_USER) User loginUser,
-                                                                               
 @RequestParam("taskId") Integer taskId) {
-        List<DynamicSubWorkflowDto> dynamicSubWorkflowDtos =
-                
workflowInstanceService.queryDynamicSubWorkflowInstances(loginUser, taskId);
-        return new Result(Status.SUCCESS.getCode(), Status.SUCCESS.getMsg(), 
dynamicSubWorkflowDtos);
-    }
-
     /**
      * query workflow instance global variables and local variables
      *
diff --git 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/DynamicSubWorkflowDto.java
 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/DynamicSubWorkflowDto.java
deleted file mode 100644
index 42b437d1b1..0000000000
--- 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/dto/DynamicSubWorkflowDto.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.api.dto;
-
-import org.apache.dolphinscheduler.common.enums.WorkflowExecutionStatus;
-
-import java.util.Map;
-
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-@Data
-@NoArgsConstructor
-public class DynamicSubWorkflowDto {
-
-    private long workflowInstanceId;
-
-    private String name;
-
-    private long index;
-
-    private Map<String, String> parameters;
-
-    private WorkflowExecutionStatus state;
-
-}
diff --git 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkflowInstanceService.java
 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkflowInstanceService.java
index 6c3e817535..c38d01ac55 100644
--- 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkflowInstanceService.java
+++ 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/WorkflowInstanceService.java
@@ -17,7 +17,6 @@
 
 package org.apache.dolphinscheduler.api.service;
 
-import org.apache.dolphinscheduler.api.dto.DynamicSubWorkflowDto;
 import org.apache.dolphinscheduler.api.dto.gantt.GanttDto;
 import 
org.apache.dolphinscheduler.api.dto.workflowInstance.WorkflowInstanceTaskListDTO;
 import 
org.apache.dolphinscheduler.api.dto.workflowInstance.WorkflowInstanceVariablesDTO;
@@ -107,9 +106,6 @@ public interface WorkflowInstanceService {
                                                           long projectCode,
                                                           Integer taskId);
 
-    List<DynamicSubWorkflowDto> queryDynamicSubWorkflowInstances(User 
loginUser,
-                                                                 Integer 
taskId);
-
     /**
      * update workflow instance
      *
diff --git 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowInstanceServiceImpl.java
 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowInstanceServiceImpl.java
index 5d024bbb55..7ae496636b 100644
--- 
a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowInstanceServiceImpl.java
+++ 
b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/WorkflowInstanceServiceImpl.java
@@ -27,7 +27,6 @@ import static 
org.apache.dolphinscheduler.common.utils.JSONUtils.parseObject;
 import static 
org.apache.dolphinscheduler.plugin.task.api.TaskPluginManager.checkTaskParameters;
 
 import org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant;
-import org.apache.dolphinscheduler.api.dto.DynamicSubWorkflowDto;
 import org.apache.dolphinscheduler.api.dto.gantt.GanttDto;
 import org.apache.dolphinscheduler.api.dto.gantt.Task;
 import 
org.apache.dolphinscheduler.api.dto.workflowInstance.WorkflowInstanceTaskListDTO;
@@ -41,7 +40,6 @@ import 
org.apache.dolphinscheduler.api.service.WorkflowDefinitionService;
 import org.apache.dolphinscheduler.api.service.WorkflowInstanceService;
 import org.apache.dolphinscheduler.api.utils.PageInfo;
 import org.apache.dolphinscheduler.api.utils.Result;
-import org.apache.dolphinscheduler.common.constants.CommandKeyConstants;
 import org.apache.dolphinscheduler.common.constants.Constants;
 import org.apache.dolphinscheduler.common.enums.ContextType;
 import org.apache.dolphinscheduler.common.enums.Flag;
@@ -54,7 +52,6 @@ import 
org.apache.dolphinscheduler.common.utils.placeholder.BusinessTimeUtils;
 import org.apache.dolphinscheduler.dao.AlertDao;
 import org.apache.dolphinscheduler.dao.entity.AbstractTaskInstanceContext;
 import org.apache.dolphinscheduler.dao.entity.Project;
-import org.apache.dolphinscheduler.dao.entity.RelationSubWorkflow;
 import org.apache.dolphinscheduler.dao.entity.TaskDefinition;
 import org.apache.dolphinscheduler.dao.entity.TaskDefinitionLog;
 import org.apache.dolphinscheduler.dao.entity.TaskInstance;
@@ -64,7 +61,6 @@ import org.apache.dolphinscheduler.dao.entity.User;
 import org.apache.dolphinscheduler.dao.entity.WorkflowDefinition;
 import org.apache.dolphinscheduler.dao.entity.WorkflowInstance;
 import org.apache.dolphinscheduler.dao.entity.WorkflowTaskRelationLog;
-import org.apache.dolphinscheduler.dao.mapper.RelationSubWorkflowMapper;
 import org.apache.dolphinscheduler.dao.mapper.TaskDefinitionLogMapper;
 import org.apache.dolphinscheduler.dao.mapper.WorkflowDefinitionLogMapper;
 import org.apache.dolphinscheduler.dao.repository.ProjectDao;
@@ -88,7 +84,6 @@ import org.apache.commons.lang3.StringUtils;
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -157,9 +152,6 @@ public class WorkflowInstanceServiceImpl extends 
BaseServiceImpl implements Work
     @Autowired
     TaskDefinitionDao taskDefinitionDao;
 
-    @Autowired
-    private RelationSubWorkflowMapper relationSubWorkflowMapper;
-
     @Autowired
     private AlertDao alertDao;
 
@@ -336,57 +328,6 @@ public class WorkflowInstanceServiceImpl extends 
BaseServiceImpl implements Work
         return taskInstanceDependentDetailsList;
     }
 
-    @Override
-    public List<DynamicSubWorkflowDto> queryDynamicSubWorkflowInstances(User 
loginUser, Integer taskId) {
-        TaskInstance taskInstance = taskInstanceDao.queryById(taskId);
-        if (taskInstance == null) {
-            throw new ServiceException(Status.TASK_INSTANCE_NOT_EXISTS, 
taskId);
-        }
-
-        TaskDefinition taskDefinition = 
taskDefinitionDao.queryByCode(taskInstance.getTaskCode());
-        if (taskDefinition == null) {
-            throw new ServiceException(Status.TASK_INSTANCE_NOT_EXISTS, 
taskId);
-        }
-
-        List<RelationSubWorkflow> relationSubWorkflows = 
relationSubWorkflowMapper
-                .queryAllSubWorkflowInstance((long) 
taskInstance.getWorkflowInstanceId(),
-                        taskInstance.getTaskCode());
-        List<Long> allSubWorkflowInstanceId = relationSubWorkflows.stream()
-                
.map(RelationSubWorkflow::getSubWorkflowInstanceId).collect(Collectors.toList());
-        List<WorkflowInstance> allSubWorkflows = 
workflowInstanceDao.queryByIds(allSubWorkflowInstanceId);
-
-        if (allSubWorkflows == null || allSubWorkflows.isEmpty()) {
-            throw new ServiceException(Status.SUB_WORKFLOW_INSTANCE_NOT_EXIST, 
taskId);
-        }
-        Long subWorkflowCode = 
allSubWorkflows.get(0).getWorkflowDefinitionCode();
-        int subWorkflowVersion = 
allSubWorkflows.get(0).getWorkflowDefinitionVersion();
-        WorkflowDefinition subWorkflowDefinition =
-                processService.findWorkflowDefinition(subWorkflowCode, 
subWorkflowVersion);
-        if (subWorkflowDefinition == null) {
-            throw new ServiceException(Status.WORKFLOW_DEFINITION_NOT_EXIST, 
subWorkflowCode);
-        }
-
-        allSubWorkflows.sort(Comparator.comparing(WorkflowInstance::getId));
-
-        List<DynamicSubWorkflowDto> allDynamicSubWorkflowDtos = new 
ArrayList<>();
-        int index = 1;
-        for (WorkflowInstance workflowInstance : allSubWorkflows) {
-            DynamicSubWorkflowDto dynamicSubWorkflowDto = new 
DynamicSubWorkflowDto();
-            
dynamicSubWorkflowDto.setWorkflowInstanceId(workflowInstance.getId());
-            dynamicSubWorkflowDto.setIndex(index);
-            dynamicSubWorkflowDto.setState(workflowInstance.getState());
-            dynamicSubWorkflowDto.setName(subWorkflowDefinition.getName());
-            Map<String, String> commandParamMap = 
JSONUtils.toMap(workflowInstance.getCommandParam());
-            String parameter = 
commandParamMap.get(CommandKeyConstants.CMD_DYNAMIC_START_PARAMS);
-            dynamicSubWorkflowDto.setParameters(JSONUtils.toMap(parameter));
-            allDynamicSubWorkflowDtos.add(dynamicSubWorkflowDto);
-            index++;
-
-        }
-
-        return allDynamicSubWorkflowDtos;
-    }
-
     @Override
     public Map<String, Integer> querySubWorkflowInstanceByTaskId(User 
loginUser, long projectCode, Integer taskId) {
         Project project = projectDao.queryByCode(projectCode);
diff --git 
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/CommandKeyConstants.java
 
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/CommandKeyConstants.java
index 2a06bf784b..48ebdccea6 100644
--- 
a/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/CommandKeyConstants.java
+++ 
b/dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/constants/CommandKeyConstants.java
@@ -31,8 +31,6 @@ public class CommandKeyConstants {
 
     public static final String CMD_PARAM_START_NODES = "StartNodeList";
 
-    public static final String CMD_DYNAMIC_START_PARAMS = "dynamicParams";
-
     /**
      * complement data Schedule date
      */
diff --git 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/RelationSubWorkflowMapper.java
 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/RelationSubWorkflowMapper.java
index 78fcdd89ea..0b69bcfd5d 100644
--- 
a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/RelationSubWorkflowMapper.java
+++ 
b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/RelationSubWorkflowMapper.java
@@ -29,9 +29,6 @@ public interface RelationSubWorkflowMapper extends 
BaseMapper<RelationSubWorkflo
 
     int batchInsert(@Param("relationSubWorkflows") List<RelationSubWorkflow> 
relationSubWorkflows);
 
-    List<RelationSubWorkflow> 
queryAllSubWorkflowInstance(@Param("parentWorkflowInstanceId") Long 
parentWorkflowInstanceId,
-                                                          
@Param("parentTaskCode") Long parentTaskCode);
-
     RelationSubWorkflow 
queryParentWorkflowInstance(@Param("subWorkflowInstanceId") Long 
subWorkflowInstanceId);
 
 }
diff --git 
a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/RelationSubWorkflowMapper.xml
 
b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/RelationSubWorkflowMapper.xml
index a185a40ae4..29f731af04 100644
--- 
a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/RelationSubWorkflowMapper.xml
+++ 
b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/RelationSubWorkflowMapper.xml
@@ -28,13 +28,6 @@
             (#{relationSubWorkflow.parentWorkflowInstanceId}, 
#{relationSubWorkflow.parentTaskCode}, 
#{relationSubWorkflow.subWorkflowInstanceId})
         </foreach>
     </insert>
-    <select id="queryAllSubWorkflowInstance" 
resultType="org.apache.dolphinscheduler.dao.entity.RelationSubWorkflow">
-        select
-        id, parent_workflow_instance_id, parent_task_code, 
sub_workflow_instance_id
-        FROM t_ds_relation_sub_workflow
-        WHERE parent_workflow_instance_id = #{parentWorkflowInstanceId}
-            AND parent_task_code = #{parentTaskCode}
-    </select>
     <select id="queryParentWorkflowInstance" 
resultType="org.apache.dolphinscheduler.dao.entity.RelationSubWorkflow">
         select
             id, parent_workflow_instance_id, parent_task_code, 
sub_workflow_instance_id

Reply via email to