From cc4016f71dd135ffe1be7155f27b85186433a111 Mon Sep 17 00:00:00 2001 From: Jay Chung Date: Wed, 22 Jan 2025 10:22:52 +0800 Subject: [PATCH] fix: python gateway unable to execute workflow Add missing default value during the refactor, we refactor the WorkflowTriggerRequest and remove some of defaults value which cause python sdk could not trigger workflow via PythonGateway this patch try to fix it and I have already test in my local env, and it works again now --- .../dolphinscheduler/api/python/PythonGateway.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/python/PythonGateway.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/python/PythonGateway.java index 0166e34381e7..0149e48a8836 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/python/PythonGateway.java +++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/python/PythonGateway.java @@ -33,9 +33,11 @@ import org.apache.dolphinscheduler.api.service.UsersService; import org.apache.dolphinscheduler.api.service.WorkflowDefinitionService; import org.apache.dolphinscheduler.common.constants.Constants; +import org.apache.dolphinscheduler.common.enums.CommandType; import org.apache.dolphinscheduler.common.enums.ComplementDependentMode; import org.apache.dolphinscheduler.common.enums.ExecutionOrder; import org.apache.dolphinscheduler.common.enums.FailureStrategy; +import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.Priority; import org.apache.dolphinscheduler.common.enums.ReleaseState; import org.apache.dolphinscheduler.common.enums.RunMode; @@ -370,11 +372,9 @@ private void createOrUpdateSchedule(User user, public void execWorkflowInstance(String userName, String projectName, String workflowName, - String cronTime, String workerGroup, String warningType, - Integer warningGroupId, - Integer timeout) { + Integer warningGroupId) { User user = usersService.queryUser(userName); Project project = projectMapper.queryByName(projectName); WorkflowDefinition workflowDefinition = @@ -389,6 +389,10 @@ public void execWorkflowInstance(String userName, .workerGroup(workerGroup) .warningType(WarningType.of(warningType)) .warningGroupId(warningGroupId) + .execType(CommandType.START_PROCESS) + .taskDependType(TaskDependType.TASK_POST) + .dryRun(Flag.NO) + .testFlag(Flag.NO) .build(); executorService.triggerWorkflowDefinition(workflowTriggerRequest); }