Skip to content

Commit 128a3e9

Browse files
lileruanwenjun
authored andcommitted
change to get sub-workflow-definition-code from deserializer
1 parent 5d3a2a7 commit 128a3e9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_START_DATE;
2424
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_RECOVER_WORKFLOW_ID_STRING;
2525
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_START_NODES;
26-
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_SUB_WORKFLOW_DEFINITION_CODE;
2726
import static org.apache.dolphinscheduler.common.constants.Constants.COMMA;
2827

2928
import org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant;
@@ -72,6 +71,7 @@
7271
import org.apache.dolphinscheduler.dao.mapper.WorkflowDefinitionMapper;
7372
import org.apache.dolphinscheduler.dao.mapper.WorkflowTaskRelationMapper;
7473
import org.apache.dolphinscheduler.dao.repository.WorkflowInstanceDao;
74+
import org.apache.dolphinscheduler.plugin.task.api.parameters.SubWorkflowParameters;
7575
import org.apache.dolphinscheduler.plugin.task.api.utils.TaskTypeUtils;
7676
import org.apache.dolphinscheduler.service.command.CommandService;
7777
import org.apache.dolphinscheduler.service.cron.CronUtils;
@@ -101,6 +101,7 @@
101101
import org.springframework.stereotype.Service;
102102
import org.springframework.transaction.annotation.Transactional;
103103

104+
import com.fasterxml.jackson.core.type.TypeReference;
104105
import com.google.common.base.Splitter;
105106

106107
@Service
@@ -222,9 +223,10 @@ public boolean checkSubWorkflowDefinitionValid(WorkflowDefinition workflowDefini
222223
Set<Long> workflowDefinitionCodeSet = new HashSet<>();
223224
taskDefinitions.stream()
224225
.filter(task -> TaskTypeUtils.isSubWorkflowTask(task.getTaskType())).forEach(
225-
taskDefinition -> workflowDefinitionCodeSet.add(Long.valueOf(
226-
JSONUtils.getNodeString(taskDefinition.getTaskParams(),
227-
CMD_PARAM_SUB_WORKFLOW_DEFINITION_CODE))));
226+
taskDefinition -> workflowDefinitionCodeSet.add(
227+
JSONUtils.parseObject(taskDefinition.getTaskParams(),
228+
new TypeReference<SubWorkflowParameters>() {
229+
}).getWorkflowDefinitionCode()));
228230
if (workflowDefinitionCodeSet.isEmpty()) {
229231
return true;
230232
}

0 commit comments

Comments
 (0)