Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_COMPLEMENT_DATA_START_DATE;
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_RECOVER_WORKFLOW_ID_STRING;
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_START_NODES;
import static org.apache.dolphinscheduler.common.constants.CommandKeyConstants.CMD_PARAM_SUB_WORKFLOW_DEFINITION_CODE;
import static org.apache.dolphinscheduler.common.constants.Constants.COMMA;

import org.apache.dolphinscheduler.api.constants.ApiFuncIdentificationConstant;
Expand Down Expand Up @@ -72,6 +71,7 @@
import org.apache.dolphinscheduler.dao.mapper.WorkflowDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.WorkflowTaskRelationMapper;
import org.apache.dolphinscheduler.dao.repository.WorkflowInstanceDao;
import org.apache.dolphinscheduler.plugin.task.api.parameters.SubWorkflowParameters;
import org.apache.dolphinscheduler.plugin.task.api.utils.TaskTypeUtils;
import org.apache.dolphinscheduler.service.command.CommandService;
import org.apache.dolphinscheduler.service.cron.CronUtils;
Expand Down Expand Up @@ -101,6 +101,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.base.Splitter;

@Service
Expand Down Expand Up @@ -222,9 +223,10 @@ public boolean checkSubWorkflowDefinitionValid(WorkflowDefinition workflowDefini
Set<Long> workflowDefinitionCodeSet = new HashSet<>();
taskDefinitions.stream()
.filter(task -> TaskTypeUtils.isSubWorkflowTask(task.getTaskType())).forEach(
taskDefinition -> workflowDefinitionCodeSet.add(Long.valueOf(
JSONUtils.getNodeString(taskDefinition.getTaskParams(),
CMD_PARAM_SUB_WORKFLOW_DEFINITION_CODE))));
taskDefinition -> workflowDefinitionCodeSet.add(
JSONUtils.parseObject(taskDefinition.getTaskParams(),
new TypeReference<SubWorkflowParameters>() {
}).getWorkflowDefinitionCode()));
if (workflowDefinitionCodeSet.isEmpty()) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ public class CommandKeyConstants {
/**
* command parameter keys
*/
public static final String CMD_PARAM_RECOVER_WORKFLOW_ID_STRING = "ProcessInstanceId";
public static final String CMD_PARAM_RECOVER_WORKFLOW_ID_STRING = "WorkflowInstanceId";

public static final String CMD_PARAM_RECOVERY_START_NODE_STRING = "StartNodeIdList";

public static final String CMD_PARAM_RECOVERY_WAITING_THREAD = "WaitingThreadInstanceId";

public static final String CMD_PARAM_SUB_WORKFLOW = "processInstanceId";
public static final String CMD_PARAM_SUB_WORKFLOW = "workflowInstanceId";

public static final String CMD_PARAM_EMPTY_SUB_PROCESS = "0";

public static final String CMD_PARAM_SUB_WORKFLOW_PARENT_INSTANCE_ID = "parentProcessInstanceId";
public static final String CMD_PARAM_SUB_WORKFLOW_PARENT_INSTANCE_ID = "parentWorkflowInstanceId";

public static final String CMD_PARAM_SUB_WORKFLOW_DEFINITION_CODE = "processDefinitionCode";
public static final String CMD_PARAM_SUB_WORKFLOW_DEFINITION_CODE = "workflowDefinitionCode";

public static final String CMD_PARAM_START_NODES = "StartNodeList";

Expand Down
Loading