|
23 | 23 | import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_START_DATE; |
24 | 24 | import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_RECOVER_WORKFLOW_ID_STRING; |
25 | 25 | 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; |
27 | 26 | import static org.apache.dolphinscheduler.common.constants.Constants.COMMA; |
28 | 27 |
|
29 | 28 | import org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant; |
|
72 | 71 | import org.apache.dolphinscheduler.dao.mapper.WorkflowDefinitionMapper; |
73 | 72 | import org.apache.dolphinscheduler.dao.mapper.WorkflowTaskRelationMapper; |
74 | 73 | import org.apache.dolphinscheduler.dao.repository.WorkflowInstanceDao; |
| 74 | +import org.apache.dolphinscheduler.plugin.task.api.parameters.SubWorkflowParameters; |
75 | 75 | import org.apache.dolphinscheduler.plugin.task.api.utils.TaskTypeUtils; |
76 | 76 | import org.apache.dolphinscheduler.service.command.CommandService; |
77 | 77 | import org.apache.dolphinscheduler.service.cron.CronUtils; |
|
101 | 101 | import org.springframework.stereotype.Service; |
102 | 102 | import org.springframework.transaction.annotation.Transactional; |
103 | 103 |
|
| 104 | +import com.fasterxml.jackson.core.type.TypeReference; |
104 | 105 | import com.google.common.base.Splitter; |
105 | 106 |
|
106 | 107 | @Service |
@@ -222,9 +223,10 @@ public boolean checkSubWorkflowDefinitionValid(WorkflowDefinition workflowDefini |
222 | 223 | Set<Long> workflowDefinitionCodeSet = new HashSet<>(); |
223 | 224 | taskDefinitions.stream() |
224 | 225 | .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())); |
228 | 230 | if (workflowDefinitionCodeSet.isEmpty()) { |
229 | 231 | return true; |
230 | 232 | } |
|
0 commit comments